artifactuse 0.2.0 → 0.2.2
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/index.d.ts +11 -0
- package/dist/core/state.d.ts +6 -0
- package/dist/{index-llShix6s.js → index-INYOxlcg.js} +1134 -910
- package/dist/index.js +1 -1
- package/dist/react/index.js +408 -389
- package/dist/styles/components/panel.css +106 -0
- package/dist/svelte/index.d.ts +42 -0
- package/dist/svelte/index.js +1915 -1875
- package/dist/vue/index.d.ts +32 -0
- package/dist/vue/index.js +1258 -1191
- package/dist/vue2/composables.d.ts +32 -0
- package/dist/vue2/index.js +535 -57
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Dr = Object.defineProperty;
|
|
2
|
+
var qr = (e, t, r) => t in e ? Dr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var V = (e, t, r) => qr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
const Ee = {
|
|
5
5
|
CODE: "code",
|
|
6
6
|
FORM: "form",
|
|
7
7
|
SOCIAL: "social"
|
|
8
|
-
},
|
|
8
|
+
}, Zr = [
|
|
9
9
|
// Code languages
|
|
10
10
|
"html",
|
|
11
11
|
"htm",
|
|
@@ -61,11 +61,11 @@ const Ee = {
|
|
|
61
61
|
// Structured artifacts (form can be panel based on complexity)
|
|
62
62
|
"form"
|
|
63
63
|
];
|
|
64
|
-
function
|
|
64
|
+
function Br(e = "artifact") {
|
|
65
65
|
return `${e}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
66
66
|
}
|
|
67
67
|
function pr(e) {
|
|
68
|
-
return
|
|
68
|
+
return Zr.includes(e == null ? void 0 : e.toLowerCase());
|
|
69
69
|
}
|
|
70
70
|
function Fr(e) {
|
|
71
71
|
return Or.includes(e == null ? void 0 : e.toLowerCase());
|
|
@@ -129,7 +129,41 @@ function ot(e) {
|
|
|
129
129
|
// Structured artifacts
|
|
130
130
|
form: "Form",
|
|
131
131
|
social: "Social Preview",
|
|
132
|
-
txt: "Plain Text"
|
|
132
|
+
txt: "Plain Text",
|
|
133
|
+
plaintext: "Plain Text",
|
|
134
|
+
text: "Plain Text",
|
|
135
|
+
less: "Less",
|
|
136
|
+
sass: "Sass",
|
|
137
|
+
scss: "SCSS",
|
|
138
|
+
lua: "Lua",
|
|
139
|
+
perl: "Perl",
|
|
140
|
+
pl: "Perl",
|
|
141
|
+
r: "R",
|
|
142
|
+
dart: "Dart",
|
|
143
|
+
elixir: "Elixir",
|
|
144
|
+
ex: "Elixir",
|
|
145
|
+
haskell: "Haskell",
|
|
146
|
+
hs: "Haskell",
|
|
147
|
+
clojure: "Clojure",
|
|
148
|
+
clj: "Clojure",
|
|
149
|
+
erlang: "Erlang",
|
|
150
|
+
erl: "Erlang",
|
|
151
|
+
objectivec: "Objective-C",
|
|
152
|
+
objc: "Objective-C",
|
|
153
|
+
m: "Objective-C",
|
|
154
|
+
toml: "TOML",
|
|
155
|
+
ini: "INI",
|
|
156
|
+
env: "Environment",
|
|
157
|
+
makefile: "Makefile",
|
|
158
|
+
cmake: "CMake",
|
|
159
|
+
terraform: "Terraform",
|
|
160
|
+
tf: "Terraform",
|
|
161
|
+
hcl: "HCL",
|
|
162
|
+
protobuf: "Protocol Buffers",
|
|
163
|
+
proto: "Protocol Buffers",
|
|
164
|
+
zig: "Zig",
|
|
165
|
+
nim: "Nim",
|
|
166
|
+
v: "V"
|
|
133
167
|
}[e == null ? void 0 : e.toLowerCase()] || (e == null ? void 0 : e.toUpperCase()) || "Code";
|
|
134
168
|
}
|
|
135
169
|
function Qs(e) {
|
|
@@ -173,7 +207,42 @@ function Qs(e) {
|
|
|
173
207
|
md: "md",
|
|
174
208
|
svg: "svg",
|
|
175
209
|
form: "json",
|
|
176
|
-
social: "json"
|
|
210
|
+
social: "json",
|
|
211
|
+
txt: "txt",
|
|
212
|
+
plaintext: "txt",
|
|
213
|
+
text: "txt",
|
|
214
|
+
less: "less",
|
|
215
|
+
sass: "sass",
|
|
216
|
+
scss: "scss",
|
|
217
|
+
lua: "lua",
|
|
218
|
+
perl: "pl",
|
|
219
|
+
pl: "pl",
|
|
220
|
+
r: "r",
|
|
221
|
+
dart: "dart",
|
|
222
|
+
elixir: "ex",
|
|
223
|
+
ex: "ex",
|
|
224
|
+
haskell: "hs",
|
|
225
|
+
hs: "hs",
|
|
226
|
+
clojure: "clj",
|
|
227
|
+
clj: "clj",
|
|
228
|
+
erlang: "erl",
|
|
229
|
+
erl: "erl",
|
|
230
|
+
objectivec: "m",
|
|
231
|
+
objc: "m",
|
|
232
|
+
m: "m",
|
|
233
|
+
toml: "toml",
|
|
234
|
+
ini: "ini",
|
|
235
|
+
env: "env",
|
|
236
|
+
makefile: "mk",
|
|
237
|
+
cmake: "cmake",
|
|
238
|
+
terraform: "tf",
|
|
239
|
+
tf: "tf",
|
|
240
|
+
hcl: "hcl",
|
|
241
|
+
protobuf: "proto",
|
|
242
|
+
proto: "proto",
|
|
243
|
+
zig: "zig",
|
|
244
|
+
nim: "nim",
|
|
245
|
+
v: "v"
|
|
177
246
|
}[e == null ? void 0 : e.toLowerCase()] || "txt";
|
|
178
247
|
}
|
|
179
248
|
function Nr(e) {
|
|
@@ -211,7 +280,31 @@ function Nr(e) {
|
|
|
211
280
|
md: "markdown",
|
|
212
281
|
svg: "svg",
|
|
213
282
|
diff: "diff",
|
|
214
|
-
patch: "patch"
|
|
283
|
+
patch: "patch",
|
|
284
|
+
txt: "txt",
|
|
285
|
+
less: "less",
|
|
286
|
+
sass: "sass",
|
|
287
|
+
scss: "scss",
|
|
288
|
+
lua: "lua",
|
|
289
|
+
pl: "perl",
|
|
290
|
+
r: "r",
|
|
291
|
+
dart: "dart",
|
|
292
|
+
ex: "elixir",
|
|
293
|
+
exs: "elixir",
|
|
294
|
+
hs: "haskell",
|
|
295
|
+
clj: "clojure",
|
|
296
|
+
erl: "erlang",
|
|
297
|
+
m: "objectivec",
|
|
298
|
+
toml: "toml",
|
|
299
|
+
ini: "ini",
|
|
300
|
+
env: "env",
|
|
301
|
+
cmake: "cmake",
|
|
302
|
+
tf: "terraform",
|
|
303
|
+
hcl: "hcl",
|
|
304
|
+
proto: "proto",
|
|
305
|
+
zig: "zig",
|
|
306
|
+
nim: "nim",
|
|
307
|
+
v: "v"
|
|
215
308
|
}[e == null ? void 0 : e.toLowerCase()] || null;
|
|
216
309
|
}
|
|
217
310
|
function Ys(e) {
|
|
@@ -248,8 +341,69 @@ function Ys(e) {
|
|
|
248
341
|
videoeditor: '<polygon points="23 7 16 12 23 17 23 7"/><rect x="1" y="5" width="15" height="14" rx="2" ry="2"/>',
|
|
249
342
|
timeline: '<line x1="2" y1="12" x2="22" y2="12"/><circle cx="6" cy="12" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="18" cy="12" r="2"/>',
|
|
250
343
|
form: '<path d="M4 4h16v2H4V4zm0 4h10v2H4V8zm0 4h16v2H4v-2zm0 4h10v2H4v-2z"/><rect x="16" y="8" width="4" height="4" rx="1"/><rect x="16" y="16" width="4" height="4" rx="1"/>',
|
|
251
|
-
social: '<path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"/>'
|
|
252
|
-
|
|
344
|
+
social: '<path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"/>',
|
|
345
|
+
// Languages with display names that were missing icons
|
|
346
|
+
java: '<path d="M8.851 18.56s-.917.534.653.714c1.902.218 2.874.187 4.969-.211 0 0 .552.346 1.321.646-4.699 2.013-10.633-.118-6.943-1.149m-.575-2.627s-1.028.761.542.924c2.032.209 3.636.227 6.413-.308 0 0 .384.389.987.602-5.679 1.661-12.007.13-7.942-1.218m4.84-4.458c1.158 1.333-.304 2.533-.304 2.533s2.939-1.518 1.589-3.418c-1.261-1.772-2.228-2.652 3.007-5.688 0 0-8.216 2.051-4.292 6.573"/><path d="M16.205 20.196s.678.559-.747.991c-2.712.822-11.288 1.069-13.669.033-.856-.373.75-.89 1.254-.998.527-.114.828-.093.828-.093-.953-.671-6.156 1.317-2.643 1.887 9.58 1.553 17.462-.7 14.977-1.82M9.6 13.116s-4.362 1.036-1.544 1.412c1.189.159 3.561.123 5.77-.062 1.806-.152 3.618-.477 3.618-.477s-.637.272-1.098.587c-4.429 1.165-12.986.623-10.522-.568 2.082-1.006 3.776-.892 3.776-.892m7.816 4.368c4.502-2.34 2.421-4.589.968-4.285-.356.075-.515.14-.515.14s.132-.207.385-.296c2.874-1.01 5.086 2.981-.928 4.562 0 0 .07-.062.09-.121"/>',
|
|
347
|
+
c: '<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/><path d="M10.5 7.5C8.01 7.5 6 9.51 6 12s2.01 4.5 4.5 4.5c1.74 0 3.26-1 4-2.5h-2.18c-.5.63-1.27 1-2.12 1A2.75 2.75 0 0 1 7.5 12a2.75 2.75 0 0 1 2.7-2.5c.85 0 1.62.37 2.12 1h2.18c-.74-1.5-2.26-2.5-4-2.5z"/>',
|
|
348
|
+
cpp: '<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/><path d="M9.5 7.5C7.01 7.5 5 9.51 5 12s2.01 4.5 4.5 4.5c1.74 0 3.26-1 4-2.5h-2.18c-.5.63-1.27 1-2.12 1A2.75 2.75 0 0 1 6.5 12 2.75 2.75 0 0 1 9.2 9.5c.85 0 1.62.37 2.12 1h2.18c-.74-1.5-2.26-2.5-4-2.5z"/><path d="M16 11h1v-1h1v1h1v1h-1v1h-1v-1h-1zm-3 0h1v-1h1v1h1v1h-1v1h-1v-1h-1z"/>',
|
|
349
|
+
csharp: '<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/><path d="M9.5 7.5C7.01 7.5 5 9.51 5 12s2.01 4.5 4.5 4.5c1.74 0 3.26-1 4-2.5h-2.18c-.5.63-1.27 1-2.12 1A2.75 2.75 0 0 1 6.5 12 2.75 2.75 0 0 1 9.2 9.5c.85 0 1.62.37 2.12 1h2.18c-.74-1.5-2.26-2.5-4-2.5z"/><path d="M16.5 10.5h-1v-1h-1v1h-1v1h1v1h1v-1h1zM16.5 13.5h-1v-1h-1v1h-1v1h1v1h1v-1h1z"/>',
|
|
350
|
+
cs: '<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/><path d="M9.5 7.5C7.01 7.5 5 9.51 5 12s2.01 4.5 4.5 4.5c1.74 0 3.26-1 4-2.5h-2.18c-.5.63-1.27 1-2.12 1A2.75 2.75 0 0 1 6.5 12 2.75 2.75 0 0 1 9.2 9.5c.85 0 1.62.37 2.12 1h2.18c-.74-1.5-2.26-2.5-4-2.5z"/><path d="M16.5 10.5h-1v-1h-1v1h-1v1h1v1h1v-1h1zM16.5 13.5h-1v-1h-1v1h-1v1h1v1h1v-1h1z"/>',
|
|
351
|
+
go: '<path d="M3.5 10.83s-.1-.16.06-.21c0 0 2.61-1.05 5.25-1.05h.2c2.64 0 5.25 1.05 5.25 1.05.16.05.06.21.06.21"/><path d="M4.3 11.2c-.15 0-.15-.23 0-.23h4.96c.15 0 .15.23 0 .23H4.3z"/><ellipse cx="6.27" cy="10" rx=".35" ry=".4"/><path d="M14.26 10.83s-.1-.16.06-.21c0 0 1.61-.65 3.25-.65h.2c1.64 0 3.25.65 3.25.65.16.05.06.21.06.21"/><path d="M14.85 11.2c-.15 0-.15-.23 0-.23h4.26c.15 0 .15.23 0 .23h-4.26z"/><ellipse cx="16.57" cy="10" rx=".35" ry=".4"/><path d="M8.98 15.53c-2.6 0-4.72-1.68-4.72-3.75 0-2.07 2.12-3.75 4.72-3.75s4.72 1.68 4.72 3.75-2.12 3.75-4.72 3.75z" fill="none" stroke="currentColor" stroke-width="1"/>',
|
|
352
|
+
rust: '<path d="M12 2l1.09 3.41L15 3.5l-.47 3.53 2.97-1.87-.94 3.42 3.54.16-2.7 2.27 3.15 1.63-3.38.86 2.13 2.87-3.47-.57.78 3.45-3.05-1.73L12 21l-1.56-3.07-3.05 1.73.78-3.45-3.47.57 2.13-2.87-3.38-.86 3.15-1.63L3.9 9.15l3.54-.16-.94-3.42 2.97 1.87L9 3.5l1.91 1.91L12 2z" fill="none" stroke="currentColor" stroke-width="1.2"/><circle cx="12" cy="12" r="3" fill="none" stroke="currentColor" stroke-width="1.2"/>',
|
|
353
|
+
ruby: '<path d="M5.5 18.5L3 14l3-9 4-2h4l4 2 3 9-2.5 4.5L12 21l-6.5-2.5z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M12 3v18M3 14h18M6 5l12 14M18 5L6 19" fill="none" stroke="currentColor" stroke-width=".8"/>',
|
|
354
|
+
rb: '<path d="M5.5 18.5L3 14l3-9 4-2h4l4 2 3 9-2.5 4.5L12 21l-6.5-2.5z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M12 3v18M3 14h18M6 5l12 14M18 5L6 19" fill="none" stroke="currentColor" stroke-width=".8"/>',
|
|
355
|
+
php: '<ellipse cx="12" cy="12" rx="10" ry="6" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M7 9.5h2a1.5 1.5 0 0 1 0 3H8v2M12.5 9.5h2a1.5 1.5 0 0 1 0 3H13.5v2M17 9.5v5"/>',
|
|
356
|
+
swift: '<path d="M20.5 8c.3-1.7-.4-3.6-1.8-5-.5 2.1-1.8 3.7-3.5 4.8C12.6 5.5 9.4 3.3 6 2c.9 1.5 1.7 3 2.3 4.5C5.3 4.4 3 3 3 3s1.3 3.5 4 6.3C5.2 9 3.5 8.6 2 8c1.1 1.8 2.7 3.2 4.5 4.2-.7.2-1.5.3-2.5.3 1.5 1.5 3.5 2.5 5.5 2.5-2 2-5 3-8 3 3.5 2 7.5 3 11 1.5 5-2.2 7.5-7.5 7.5-11.5z"/>',
|
|
357
|
+
kotlin: '<path d="M3 3h18v18H3V3z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M3 3l9 9L3 21M12 3l9 9-9 9"/>',
|
|
358
|
+
scala: '<path d="M4 4c0 0 8 1 16 1v5c-8 0-16-1-16-1V4z"/><path d="M4 10c0 0 8 1 16 1v5c-8 0-16-1-16-1V10z"/><path d="M4 16c0 0 8 1 16 1v4c-8 0-16-1-16-1V16z"/>',
|
|
359
|
+
powershell: '<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-2m0 2v12h16V6H4m2 2l5 3.5L6 15m6 0h5"/>',
|
|
360
|
+
ps1: '<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-2m0 2v12h16V6H4m2 2l5 3.5L6 15m6 0h5"/>',
|
|
361
|
+
xml: '<path d="M7 4l-4 8 4 8M17 4l4 8-4 8M14 4l-4 16"/>',
|
|
362
|
+
yaml: '<path d="M3 4l4.5 5.5L12 4M12 4l4.5 5.5L21 4M12 9.5V20M3 12h18" fill="none" stroke="currentColor" stroke-width="1.5"/>',
|
|
363
|
+
yml: '<path d="M3 4l4.5 5.5L12 4M12 4l4.5 5.5L21 4M12 9.5V20M3 12h18" fill="none" stroke="currentColor" stroke-width="1.5"/>',
|
|
364
|
+
graphql: '<circle cx="12" cy="4" r="1.5"/><circle cx="5" cy="8" r="1.5"/><circle cx="19" cy="8" r="1.5"/><circle cx="5" cy="16" r="1.5"/><circle cx="19" cy="16" r="1.5"/><circle cx="12" cy="20" r="1.5"/><path d="M5.5 8.5l6.5 11M12.5 4.5l6 3.5M5.5 8l13 0M5.5 16l13 0M18 16.5l-6 3.5M5.5 16l6.5-12" fill="none" stroke="currentColor" stroke-width="1"/>',
|
|
365
|
+
dockerfile: '<path d="M2 12.5h3v-3h3v-3h3V3.5h3v3h3v3h1.5a2.5 2.5 0 0 1 0 5H2v-2z"/><path d="M5 9.5h2v2H5zM8 9.5h2v2H8zM8 6.5h2v2H8zM11 6.5h2v2h-2zM11 9.5h2v2h-2zM14 9.5h2v2h-2zM11 3.5h2v2h-2z"/>',
|
|
366
|
+
docker: '<path d="M2 12.5h3v-3h3v-3h3V3.5h3v3h3v3h1.5a2.5 2.5 0 0 1 0 5H2v-2z"/><path d="M5 9.5h2v2H5zM8 9.5h2v2H8zM8 6.5h2v2H8zM11 6.5h2v2h-2zM11 9.5h2v2h-2zM14 9.5h2v2h-2zM11 3.5h2v2h-2z"/>',
|
|
367
|
+
// CSS preprocessors
|
|
368
|
+
less: '<path d="M5 3l.65 3.34h12.59l-.44 2.16H6.11l.65 3.34h11.04l-.78 3.86-5.02 1.67-4.96-1.67-.33-1.69H4.38l.65 3.35L12 19.31l7.02-2.31L20.93 3H5z"/>',
|
|
369
|
+
sass: '<path d="M5 3l.65 3.34h12.59l-.44 2.16H6.11l.65 3.34h11.04l-.78 3.86-5.02 1.67-4.96-1.67-.33-1.69H4.38l.65 3.35L12 19.31l7.02-2.31L20.93 3H5z"/>',
|
|
370
|
+
scss: '<path d="M5 3l.65 3.34h12.59l-.44 2.16H6.11l.65 3.34h11.04l-.78 3.86-5.02 1.67-4.96-1.67-.33-1.69H4.38l.65 3.35L12 19.31l7.02-2.31L20.93 3H5z"/>',
|
|
371
|
+
// New languages
|
|
372
|
+
lua: '<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z" fill="none" stroke="currentColor" stroke-width="1.5"/><circle cx="12" cy="12" r="4" fill="none" stroke="currentColor" stroke-width="1.5"/><circle cx="18" cy="5" r="2"/>',
|
|
373
|
+
perl: '<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M9 8v8M9 12h3a2 2 0 1 0 0-4H9"/>',
|
|
374
|
+
pl: '<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M9 8v8M9 12h3a2 2 0 1 0 0-4H9"/>',
|
|
375
|
+
r: '<path d="M3 5h14a4 4 0 0 1 4 4v0a4 4 0 0 1-4 4H3V5z" fill="none" stroke="currentColor" stroke-width="1.5"/><path d="M3 5v14M13 13l5 6" fill="none" stroke="currentColor" stroke-width="1.5"/>',
|
|
376
|
+
dart: '<path d="M4 12L2 6l4-4h6l10 10-6 10H8l-4-4v-6z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M6 2l16 10M2 6l10 16"/>',
|
|
377
|
+
elixir: '<path d="M12 2c-3 4-6 8-6 13a6 6 0 0 0 12 0c0-5-3-9-6-13z" fill="none" stroke="currentColor" stroke-width="1.5"/><ellipse cx="12" cy="16" rx="3" ry="2" fill="none" stroke="currentColor" stroke-width="1"/>',
|
|
378
|
+
ex: '<path d="M12 2c-3 4-6 8-6 13a6 6 0 0 0 12 0c0-5-3-9-6-13z" fill="none" stroke="currentColor" stroke-width="1.5"/><ellipse cx="12" cy="16" rx="3" ry="2" fill="none" stroke="currentColor" stroke-width="1"/>',
|
|
379
|
+
haskell: '<path d="M2 4l5 8-5 8M7 4l5 8-5 8" fill="none" stroke="currentColor" stroke-width="2"/><path d="M12 8l2 4-2 4M14 10h8M14 14h8" fill="none" stroke="currentColor" stroke-width="1.5"/>',
|
|
380
|
+
hs: '<path d="M2 4l5 8-5 8M7 4l5 8-5 8" fill="none" stroke="currentColor" stroke-width="2"/><path d="M12 8l2 4-2 4M14 10h8M14 14h8" fill="none" stroke="currentColor" stroke-width="1.5"/>',
|
|
381
|
+
clojure: '<circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="1.5"/><path d="M8 6a7.5 7.5 0 0 0 0 12M16 6a7.5 7.5 0 0 1 0 12"/>',
|
|
382
|
+
clj: '<circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="1.5"/><path d="M8 6a7.5 7.5 0 0 0 0 12M16 6a7.5 7.5 0 0 1 0 12"/>',
|
|
383
|
+
erlang: '<path d="M4 18c2-1.5 3-4 3-6s-1-4.5-3-6M20 18c-3-1-5.5-3.5-5.5-6S17 5.5 20 6" fill="none" stroke="currentColor" stroke-width="1.5"/><path d="M4 12h16" fill="none" stroke="currentColor" stroke-width="1.5"/>',
|
|
384
|
+
erl: '<path d="M4 18c2-1.5 3-4 3-6s-1-4.5-3-6M20 18c-3-1-5.5-3.5-5.5-6S17 5.5 20 6" fill="none" stroke="currentColor" stroke-width="1.5"/><path d="M4 12h16" fill="none" stroke="currentColor" stroke-width="1.5"/>',
|
|
385
|
+
objectivec: '<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/><path d="M10.5 7.5C8.01 7.5 6 9.51 6 12s2.01 4.5 4.5 4.5c1.74 0 3.26-1 4-2.5h-2.18c-.5.63-1.27 1-2.12 1A2.75 2.75 0 0 1 7.5 12a2.75 2.75 0 0 1 2.7-2.5c.85 0 1.62.37 2.12 1h2.18c-.74-1.5-2.26-2.5-4-2.5z"/>',
|
|
386
|
+
objc: '<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/><path d="M10.5 7.5C8.01 7.5 6 9.51 6 12s2.01 4.5 4.5 4.5c1.74 0 3.26-1 4-2.5h-2.18c-.5.63-1.27 1-2.12 1A2.75 2.75 0 0 1 7.5 12a2.75 2.75 0 0 1 2.7-2.5c.85 0 1.62.37 2.12 1h2.18c-.74-1.5-2.26-2.5-4-2.5z"/>',
|
|
387
|
+
m: '<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/><path d="M10.5 7.5C8.01 7.5 6 9.51 6 12s2.01 4.5 4.5 4.5c1.74 0 3.26-1 4-2.5h-2.18c-.5.63-1.27 1-2.12 1A2.75 2.75 0 0 1 7.5 12a2.75 2.75 0 0 1 2.7-2.5c.85 0 1.62.37 2.12 1h2.18c-.74-1.5-2.26-2.5-4-2.5z"/>',
|
|
388
|
+
// Config/build files
|
|
389
|
+
toml: '<path d="M3 3h18v18H3V3z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M7 7h10M7 11h7M7 15h10"/>',
|
|
390
|
+
ini: '<path d="M3 3h18v18H3V3z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M7 7h10M7 11h7M7 15h10"/>',
|
|
391
|
+
env: '<path d="M3 3h18v18H3V3z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M7 7h10M7 11h7M7 15h10"/>',
|
|
392
|
+
makefile: '<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-2m0 2v12h16V6H4m2 2l4 3-4 3V8m5 5h5v2h-5v-2z"/>',
|
|
393
|
+
cmake: '<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-2m0 2v12h16V6H4m2 2l4 3-4 3V8m5 5h5v2h-5v-2z"/>',
|
|
394
|
+
terraform: '<path d="M1 5l7 4v8l-7-4V5zM9 1l7 4v8l-7-4V1zM9 13l7 4v8l-7-4v-8zM17 5l7 4v8l-7-4V5z"/>',
|
|
395
|
+
tf: '<path d="M1 5l7 4v8l-7-4V5zM9 1l7 4v8l-7-4V1zM9 13l7 4v8l-7-4v-8zM17 5l7 4v8l-7-4V5z"/>',
|
|
396
|
+
hcl: '<path d="M1 5l7 4v8l-7-4V5zM9 1l7 4v8l-7-4V1zM9 13l7 4v8l-7-4v-8zM17 5l7 4v8l-7-4V5z"/>',
|
|
397
|
+
protobuf: '<path d="M4 4h16v16H4V4z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M8 8h8M8 12h5M8 16h8"/>',
|
|
398
|
+
proto: '<path d="M4 4h16v16H4V4z" fill="none" stroke="currentColor" stroke-width="1.2"/><path d="M8 8h8M8 12h5M8 16h8"/>',
|
|
399
|
+
zig: '<path d="M2 6h7l-5 12h7l5-12h7l-5 12h7" fill="none" stroke="currentColor" stroke-width="1.5"/>',
|
|
400
|
+
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"/>',
|
|
401
|
+
v: '<path d="M4 4l8 16 8-16" fill="none" stroke="currentColor" stroke-width="2"/>',
|
|
402
|
+
// Text/document icon
|
|
403
|
+
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"/>',
|
|
404
|
+
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"/>',
|
|
405
|
+
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"/>'
|
|
406
|
+
}[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"/>';
|
|
253
407
|
}
|
|
254
408
|
function en(e) {
|
|
255
409
|
if (e === 0) return "0 Bytes";
|
|
@@ -260,7 +414,7 @@ function fr(e) {
|
|
|
260
414
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&").replace(/ /g, `
|
|
261
415
|
`).replace(/ /g, "\r").replace(/	/g, " ").replace(/ /g, " ");
|
|
262
416
|
}
|
|
263
|
-
function
|
|
417
|
+
function lt(e) {
|
|
264
418
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">");
|
|
265
419
|
}
|
|
266
420
|
function Ur(e) {
|
|
@@ -271,18 +425,18 @@ function Gr(e, t) {
|
|
|
271
425
|
const r = t == null ? void 0 : t.toLowerCase();
|
|
272
426
|
if (r === "smartdiff")
|
|
273
427
|
try {
|
|
274
|
-
const
|
|
275
|
-
return
|
|
428
|
+
const l = JSON.parse(e);
|
|
429
|
+
return l.language ? `${ot(l.language)} Diff` : "Smart Diff";
|
|
276
430
|
} catch {
|
|
277
431
|
return "Smart Diff";
|
|
278
432
|
}
|
|
279
433
|
if (r === "form" || r === "social")
|
|
280
434
|
try {
|
|
281
|
-
const
|
|
435
|
+
const l = JSON.parse(e);
|
|
282
436
|
if (r === "form")
|
|
283
|
-
return
|
|
437
|
+
return l.title || "Form";
|
|
284
438
|
if (r === "social")
|
|
285
|
-
return `Social Preview - ${
|
|
439
|
+
return `Social Preview - ${l.platform || "twitter"}`;
|
|
286
440
|
} catch {
|
|
287
441
|
}
|
|
288
442
|
const a = e.match(/(?:\/\/|\/\*|<!--)\s*(?:filename|file):\s*([^\n*\->\s]+)/i);
|
|
@@ -297,8 +451,8 @@ function Gr(e, t) {
|
|
|
297
451
|
const i = e.match(/(?:export\s+)?const\s+([A-Z][a-zA-Z0-9]+)\s*=\s*(?:\([^)]*\)|[a-zA-Z]+)\s*=>/);
|
|
298
452
|
if (i) return i[1];
|
|
299
453
|
if (r === "python" || r === "py") {
|
|
300
|
-
const
|
|
301
|
-
if (
|
|
454
|
+
const l = e.match(/class\s+([A-Z][a-zA-Z0-9_]+)/);
|
|
455
|
+
if (l) return l[1];
|
|
302
456
|
const d = e.match(/def\s+([a-z_][a-zA-Z0-9_]+)\s*\(/);
|
|
303
457
|
if (d && d[1] !== "main") return d[1];
|
|
304
458
|
}
|
|
@@ -320,28 +474,28 @@ function Xr(e, t, r, a) {
|
|
|
320
474
|
const s = a.maxLines || 15;
|
|
321
475
|
function n(f, b) {
|
|
322
476
|
if (b) return !1;
|
|
323
|
-
const
|
|
324
|
-
if (
|
|
325
|
-
const
|
|
326
|
-
return f <
|
|
477
|
+
const v = a.minClickableLines;
|
|
478
|
+
if (v == null) return !1;
|
|
479
|
+
const M = typeof v == "number" ? v : v.lines || 0, $ = typeof v == "object" && Array.isArray(v.ignoreLanguages) ? v.ignoreLanguages : [];
|
|
480
|
+
return f < M && !$.includes(r);
|
|
327
481
|
}
|
|
328
482
|
function o(f, b) {
|
|
329
|
-
const
|
|
330
|
-
let
|
|
331
|
-
return typeof
|
|
483
|
+
const v = a.actionLabel;
|
|
484
|
+
let M;
|
|
485
|
+
return typeof v == "string" ? M = v : v && typeof v == "object" && (M = v[f] || v.default || null), M || (M = f === "diff" || f === "patch" || f === "smartdiff" ? "View full diff" : "View full code"), `${M} (${b} lines)`;
|
|
332
486
|
}
|
|
333
487
|
if (r === "smartdiff")
|
|
334
488
|
try {
|
|
335
|
-
const f = JSON.parse(t),
|
|
336
|
-
`),
|
|
337
|
-
`)),
|
|
338
|
-
return `<div class="artifactuse-inline-preview${
|
|
489
|
+
const f = JSON.parse(t), v = Wr(f.oldCode, f.newCode).split(`
|
|
490
|
+
`), M = v.slice(0, s), $ = M.map((I) => I[0] || " "), z = M.map((I) => I.slice(1)), S = lt(z.join(`
|
|
491
|
+
`)), y = v.length > s, C = f.language || "plaintext", x = n(v.length, y), E = x ? " artifactuse-inline-preview--static" : "", T = x ? ' data-non-clickable="true"' : "", L = o("smartdiff", v.length);
|
|
492
|
+
return `<div class="artifactuse-inline-preview${y ? " artifactuse-inline-preview--truncated" : ""}${E}" data-artifact-id="${e.id}" data-smartdiff="true" data-smartdiff-markers="${$.join(",")}"${T}><pre class="artifactuse-inline-preview__pre"><code class="language-${C}">${S}</code></pre>` + (y ? `<div class="artifactuse-inline-preview__fade"><span class="artifactuse-inline-preview__action">${L}</span></div>` : "") + "</div>";
|
|
339
493
|
} catch {
|
|
340
494
|
}
|
|
341
495
|
let i = t, u = r;
|
|
342
|
-
const
|
|
343
|
-
`), d =
|
|
344
|
-
`), p =
|
|
496
|
+
const l = i.split(`
|
|
497
|
+
`), d = l.slice(0, s).join(`
|
|
498
|
+
`), p = lt(d), w = l.length > s, c = n(l.length, w), m = c ? " artifactuse-inline-preview--static" : "", h = c ? ' data-non-clickable="true"' : "", g = o(r, l.length);
|
|
345
499
|
return `<div class="artifactuse-inline-preview${w ? " artifactuse-inline-preview--truncated" : ""}${m}" data-artifact-id="${e.id}"${h}><pre class="artifactuse-inline-preview__pre"><code class="language-${u}">${p}</code></pre>` + (w ? `<div class="artifactuse-inline-preview__fade"><span class="artifactuse-inline-preview__action">${g}</span></div>` : "") + "</div>";
|
|
346
500
|
}
|
|
347
501
|
function Kr(e, t = "panel") {
|
|
@@ -374,7 +528,7 @@ function Yr(e) {
|
|
|
374
528
|
const t = e == null ? void 0 : e.toLowerCase();
|
|
375
529
|
return t === "form" ? Ee.FORM : t === "social" ? Ee.SOCIAL : Ee.CODE;
|
|
376
530
|
}
|
|
377
|
-
function
|
|
531
|
+
function Me(e, t, r, a) {
|
|
378
532
|
const s = t == null ? void 0 : t.toLowerCase(), n = Yr(s), o = Qr(s, e);
|
|
379
533
|
return {
|
|
380
534
|
id: `${r}-${n}-${a}`,
|
|
@@ -399,10 +553,10 @@ function tn(e, t) {
|
|
|
399
553
|
const o = s[1], i = fr(s[2]);
|
|
400
554
|
let u = o.toLowerCase();
|
|
401
555
|
if ((["xml", "markup", "html", "htm"].includes(u) || !u) && (i.trim().startsWith("<svg") || i.includes("<svg ") || i.includes("<svg>")) && (u = "svg"), (u === "form" || u === "social") && !hr(i)) {
|
|
402
|
-
r.push(
|
|
556
|
+
r.push(Me(i, "json", t, n)), n++;
|
|
403
557
|
continue;
|
|
404
558
|
}
|
|
405
|
-
r.push(
|
|
559
|
+
r.push(Me(i, u, t, n)), n++;
|
|
406
560
|
}
|
|
407
561
|
return r;
|
|
408
562
|
}
|
|
@@ -414,7 +568,7 @@ function ea(e, t, r = {}) {
|
|
|
414
568
|
inlinePreview: o = null,
|
|
415
569
|
inlineCode: i = null,
|
|
416
570
|
tabs: u = null,
|
|
417
|
-
viewMode:
|
|
571
|
+
viewMode: l = null
|
|
418
572
|
} = r;
|
|
419
573
|
function d(g) {
|
|
420
574
|
return o ? o.languages === !0 ? !(Array.isArray(o.excludeLanguages) && o.excludeLanguages.includes(g)) : Array.isArray(o.languages) ? o.languages.includes(g) : !1 : !1;
|
|
@@ -422,22 +576,22 @@ function ea(e, t, r = {}) {
|
|
|
422
576
|
function p(g) {
|
|
423
577
|
return i ? i.languages === !0 ? !0 : Array.isArray(i.languages) ? i.languages.includes(g) : !1 : !1;
|
|
424
578
|
}
|
|
425
|
-
const w = [],
|
|
579
|
+
const w = [], c = /<pre><code class="language-(\w+)">([\s\S]*?)<\/code><\/pre>/gi;
|
|
426
580
|
let m = 0;
|
|
427
|
-
const h = e.replace(
|
|
428
|
-
const
|
|
581
|
+
const h = e.replace(c, (g, f, b) => {
|
|
582
|
+
const v = fr(b).trim(), M = v.split(`
|
|
429
583
|
`).length;
|
|
430
|
-
let
|
|
431
|
-
if ((["xml", "markup", "html", "htm"].includes(
|
|
584
|
+
let $ = f.toLowerCase();
|
|
585
|
+
if ((["xml", "markup", "html", "htm"].includes($) || !$) && v.trim().startsWith("<svg") && ($ = "svg"), p($))
|
|
432
586
|
return m++, g;
|
|
433
|
-
const
|
|
434
|
-
let
|
|
435
|
-
if (n ?
|
|
436
|
-
const
|
|
437
|
-
if (u && (
|
|
438
|
-
return Xr(
|
|
439
|
-
let
|
|
440
|
-
return
|
|
587
|
+
const z = pr($);
|
|
588
|
+
let S = !1;
|
|
589
|
+
if (n ? S = !0 : $ === "diff" || $ === "patch" || $ === "smartdiff" ? S = M > 10 : z ? S = !0 : S = v.length >= s && M >= a, !S && d($) && (S = !0), S) {
|
|
590
|
+
const y = Me(v, $, t, m);
|
|
591
|
+
if (u && (y.tabs = u), l && (y.viewMode = l), m++, w.push(y), d($))
|
|
592
|
+
return Xr(y, v, $, o);
|
|
593
|
+
let C = "panel";
|
|
594
|
+
return y.isInline && (C = y.type === "social" ? "inline-social" : "inline-form"), Kr(y, C);
|
|
441
595
|
}
|
|
442
596
|
return m++, g;
|
|
443
597
|
});
|
|
@@ -453,66 +607,74 @@ function ta() {
|
|
|
453
607
|
isPanelOpen: !1,
|
|
454
608
|
viewMode: "preview",
|
|
455
609
|
// 'preview' | 'code' | 'split'
|
|
456
|
-
isFullscreen: !1
|
|
610
|
+
isFullscreen: !1,
|
|
611
|
+
// Multi-tab support
|
|
612
|
+
openTabs: [],
|
|
613
|
+
// Array of artifact IDs open as tabs (ordered)
|
|
614
|
+
tabViewModes: {}
|
|
615
|
+
// { [artifactId]: 'preview' | 'code' | 'split' | 'edit' }
|
|
457
616
|
};
|
|
458
617
|
const t = /* @__PURE__ */ new Set();
|
|
459
618
|
function r() {
|
|
460
|
-
t.forEach((
|
|
619
|
+
t.forEach((y) => {
|
|
461
620
|
try {
|
|
462
|
-
|
|
463
|
-
} catch (
|
|
464
|
-
console.error("Artifactuse state subscriber error:",
|
|
621
|
+
y(e);
|
|
622
|
+
} catch (C) {
|
|
623
|
+
console.error("Artifactuse state subscriber error:", C);
|
|
465
624
|
}
|
|
466
625
|
});
|
|
467
626
|
}
|
|
468
|
-
function a(
|
|
469
|
-
return t.add(
|
|
470
|
-
t.delete(
|
|
627
|
+
function a(y) {
|
|
628
|
+
return t.add(y), y(e), () => {
|
|
629
|
+
t.delete(y);
|
|
471
630
|
};
|
|
472
631
|
}
|
|
473
632
|
function s() {
|
|
474
633
|
return { ...e };
|
|
475
634
|
}
|
|
476
|
-
function n(
|
|
477
|
-
const
|
|
478
|
-
if (
|
|
635
|
+
function n(y) {
|
|
636
|
+
const C = e.artifacts.findIndex((x) => x.id === y.id);
|
|
637
|
+
if (C === -1)
|
|
479
638
|
e = {
|
|
480
639
|
...e,
|
|
481
|
-
artifacts: [...e.artifacts,
|
|
640
|
+
artifacts: [...e.artifacts, y]
|
|
482
641
|
};
|
|
483
642
|
else {
|
|
484
|
-
const
|
|
485
|
-
|
|
643
|
+
const x = [...e.artifacts];
|
|
644
|
+
x[C] = { ...x[C], ...y }, e = {
|
|
486
645
|
...e,
|
|
487
|
-
artifacts:
|
|
646
|
+
artifacts: x
|
|
488
647
|
};
|
|
489
648
|
}
|
|
490
649
|
r();
|
|
491
650
|
}
|
|
492
|
-
function o(
|
|
493
|
-
|
|
651
|
+
function o(y) {
|
|
652
|
+
y.forEach(n);
|
|
494
653
|
}
|
|
495
|
-
function i(
|
|
654
|
+
function i(y) {
|
|
655
|
+
const C = e.openTabs.filter((T) => T !== y), { [y]: x, ...E } = e.tabViewModes;
|
|
496
656
|
e = {
|
|
497
657
|
...e,
|
|
498
|
-
artifacts: e.artifacts.filter((
|
|
499
|
-
activeArtifactId: e.activeArtifactId ===
|
|
500
|
-
isPanelOpen: e.activeArtifactId ===
|
|
658
|
+
artifacts: e.artifacts.filter((T) => T.id !== y),
|
|
659
|
+
activeArtifactId: e.activeArtifactId === y ? null : e.activeArtifactId,
|
|
660
|
+
isPanelOpen: e.activeArtifactId === y ? !1 : e.isPanelOpen,
|
|
661
|
+
openTabs: C,
|
|
662
|
+
tabViewModes: E
|
|
501
663
|
}, r();
|
|
502
664
|
}
|
|
503
|
-
function u(
|
|
504
|
-
return e.artifacts.find((
|
|
665
|
+
function u(y) {
|
|
666
|
+
return e.artifacts.find((C) => C.id === y) || null;
|
|
505
667
|
}
|
|
506
|
-
function
|
|
668
|
+
function l() {
|
|
507
669
|
return e.activeArtifactId ? u(e.activeArtifactId) : null;
|
|
508
670
|
}
|
|
509
|
-
function d(
|
|
510
|
-
const
|
|
511
|
-
let
|
|
512
|
-
x != null &&
|
|
671
|
+
function d(y) {
|
|
672
|
+
const C = u(y);
|
|
673
|
+
let x = e.tabViewModes[y];
|
|
674
|
+
x || (x = (C == null ? void 0 : C.isPreviewable) === !1 ? "code" : "preview", C != null && C.tabs && !C.tabs.includes(x) && (x = C.tabs[0])), e = {
|
|
513
675
|
...e,
|
|
514
|
-
activeArtifactId:
|
|
515
|
-
viewMode:
|
|
676
|
+
activeArtifactId: y,
|
|
677
|
+
viewMode: x
|
|
516
678
|
}, r();
|
|
517
679
|
}
|
|
518
680
|
function p() {
|
|
@@ -521,60 +683,111 @@ function ta() {
|
|
|
521
683
|
activeArtifactId: null
|
|
522
684
|
}, r();
|
|
523
685
|
}
|
|
524
|
-
function w(
|
|
686
|
+
function w(y) {
|
|
525
687
|
e = {
|
|
526
688
|
...e,
|
|
527
|
-
isPanelOpen:
|
|
528
|
-
isFullscreen:
|
|
689
|
+
isPanelOpen: y,
|
|
690
|
+
isFullscreen: y ? e.isFullscreen : !1
|
|
529
691
|
}, r();
|
|
530
692
|
}
|
|
531
|
-
function
|
|
532
|
-
if (!["preview", "code", "split", "edit"].includes(
|
|
533
|
-
console.warn(`Invalid view mode: ${
|
|
693
|
+
function c(y) {
|
|
694
|
+
if (!["preview", "code", "split", "edit"].includes(y)) {
|
|
695
|
+
console.warn(`Invalid view mode: ${y}`);
|
|
534
696
|
return;
|
|
535
697
|
}
|
|
698
|
+
const C = e.activeArtifactId ? { ...e.tabViewModes, [e.activeArtifactId]: y } : e.tabViewModes;
|
|
536
699
|
e = {
|
|
537
700
|
...e,
|
|
538
|
-
viewMode:
|
|
701
|
+
viewMode: y,
|
|
702
|
+
tabViewModes: C
|
|
539
703
|
}, r();
|
|
540
704
|
}
|
|
541
|
-
function m(
|
|
705
|
+
function m(y) {
|
|
542
706
|
e = {
|
|
543
707
|
...e,
|
|
544
|
-
isFullscreen:
|
|
708
|
+
isFullscreen: y
|
|
545
709
|
}, r();
|
|
546
710
|
}
|
|
547
|
-
function h(
|
|
548
|
-
return e.artifacts.filter((
|
|
711
|
+
function h(y) {
|
|
712
|
+
return e.artifacts.filter((C) => C.messageId === y);
|
|
549
713
|
}
|
|
550
|
-
function g(
|
|
551
|
-
return e.artifacts.filter((
|
|
714
|
+
function g(y) {
|
|
715
|
+
return e.artifacts.filter((C) => C.type === y);
|
|
552
716
|
}
|
|
553
717
|
function f() {
|
|
554
718
|
return e.artifacts.length;
|
|
555
719
|
}
|
|
556
|
-
function b() {
|
|
720
|
+
function b(y) {
|
|
721
|
+
const C = u(y);
|
|
722
|
+
if (!C) return;
|
|
723
|
+
const E = e.openTabs.includes(y) ? e.openTabs : [...e.openTabs, y];
|
|
724
|
+
let T = e.tabViewModes[y];
|
|
725
|
+
T || (T = C.isPreviewable === !1 ? "code" : "preview", C.tabs && !C.tabs.includes(T) && (T = C.tabs[0])), e = {
|
|
726
|
+
...e,
|
|
727
|
+
openTabs: E,
|
|
728
|
+
activeArtifactId: y,
|
|
729
|
+
tabViewModes: { ...e.tabViewModes, [y]: T },
|
|
730
|
+
viewMode: T
|
|
731
|
+
}, r();
|
|
732
|
+
}
|
|
733
|
+
function v(y) {
|
|
734
|
+
const C = e.openTabs.indexOf(y);
|
|
735
|
+
if (C === -1) return;
|
|
736
|
+
const x = e.openTabs.filter((G) => G !== y), { [y]: E, ...T } = e.tabViewModes;
|
|
737
|
+
let L = e.activeArtifactId;
|
|
738
|
+
e.activeArtifactId === y && (x.length === 0 ? L = null : C >= x.length ? L = x[x.length - 1] : L = x[C]);
|
|
739
|
+
const I = L && T[L] || "preview";
|
|
740
|
+
e = {
|
|
741
|
+
...e,
|
|
742
|
+
openTabs: x,
|
|
743
|
+
activeArtifactId: L,
|
|
744
|
+
tabViewModes: T,
|
|
745
|
+
viewMode: I
|
|
746
|
+
}, r();
|
|
747
|
+
}
|
|
748
|
+
function M(y) {
|
|
749
|
+
if (!u(y)) return;
|
|
750
|
+
const x = e.tabViewModes[y] || e.viewMode;
|
|
751
|
+
e = {
|
|
752
|
+
...e,
|
|
753
|
+
openTabs: [y],
|
|
754
|
+
activeArtifactId: y,
|
|
755
|
+
tabViewModes: { [y]: x },
|
|
756
|
+
viewMode: x
|
|
757
|
+
}, r();
|
|
758
|
+
}
|
|
759
|
+
function $() {
|
|
760
|
+
e = {
|
|
761
|
+
...e,
|
|
762
|
+
openTabs: [],
|
|
763
|
+
activeArtifactId: null,
|
|
764
|
+
tabViewModes: {}
|
|
765
|
+
}, r();
|
|
766
|
+
}
|
|
767
|
+
function z() {
|
|
557
768
|
e = {
|
|
558
769
|
artifacts: [],
|
|
559
770
|
activeArtifactId: null,
|
|
560
771
|
isPanelOpen: !1,
|
|
561
772
|
viewMode: "preview",
|
|
562
|
-
isFullscreen: !1
|
|
773
|
+
isFullscreen: !1,
|
|
774
|
+
openTabs: [],
|
|
775
|
+
tabViewModes: {}
|
|
563
776
|
}, r();
|
|
564
777
|
}
|
|
565
|
-
function y
|
|
566
|
-
const
|
|
567
|
-
let
|
|
568
|
-
const
|
|
569
|
-
|
|
778
|
+
function S(y) {
|
|
779
|
+
const C = r;
|
|
780
|
+
let x = !1;
|
|
781
|
+
const E = () => {
|
|
782
|
+
x = !0;
|
|
570
783
|
};
|
|
571
784
|
try {
|
|
572
785
|
Object.defineProperty(window, "__artifactuse_notify__", {
|
|
573
|
-
value:
|
|
786
|
+
value: E,
|
|
574
787
|
configurable: !0
|
|
575
|
-
}),
|
|
788
|
+
}), y();
|
|
576
789
|
} finally {
|
|
577
|
-
delete window.__artifactuse_notify__,
|
|
790
|
+
delete window.__artifactuse_notify__, x && C();
|
|
578
791
|
}
|
|
579
792
|
}
|
|
580
793
|
return {
|
|
@@ -586,7 +799,7 @@ function ta() {
|
|
|
586
799
|
addArtifacts: o,
|
|
587
800
|
removeArtifact: i,
|
|
588
801
|
getArtifact: u,
|
|
589
|
-
getActiveArtifact:
|
|
802
|
+
getActiveArtifact: l,
|
|
590
803
|
getArtifactsByMessageId: h,
|
|
591
804
|
getArtifactsByType: g,
|
|
592
805
|
getArtifactCount: f,
|
|
@@ -594,14 +807,19 @@ function ta() {
|
|
|
594
807
|
setActiveArtifact: d,
|
|
595
808
|
clearActiveArtifact: p,
|
|
596
809
|
setPanelOpen: w,
|
|
597
|
-
setViewMode:
|
|
810
|
+
setViewMode: c,
|
|
598
811
|
setFullscreen: m,
|
|
812
|
+
// Multi-tab
|
|
813
|
+
openTab: b,
|
|
814
|
+
closeTab: v,
|
|
815
|
+
closeOtherTabs: M,
|
|
816
|
+
closeAllTabs: $,
|
|
599
817
|
// Utilities
|
|
600
|
-
clear:
|
|
601
|
-
batch:
|
|
818
|
+
clear: z,
|
|
819
|
+
batch: S
|
|
602
820
|
};
|
|
603
821
|
}
|
|
604
|
-
function
|
|
822
|
+
function ct(e) {
|
|
605
823
|
try {
|
|
606
824
|
return new URL(e).hostname;
|
|
607
825
|
} catch {
|
|
@@ -612,129 +830,129 @@ function ra(e = []) {
|
|
|
612
830
|
const t = Array.isArray(e) ? e : [e].filter(Boolean), r = new Set(t), a = /* @__PURE__ */ new Map();
|
|
613
831
|
let s = null, n = !1, o = !1;
|
|
614
832
|
const i = [];
|
|
615
|
-
function u(
|
|
833
|
+
function u(x) {
|
|
616
834
|
if (r.size === 0)
|
|
617
835
|
return console.warn("Artifactuse bridge: No allowed origins configured, accepting all messages"), !0;
|
|
618
|
-
const
|
|
619
|
-
if (!
|
|
620
|
-
for (const
|
|
621
|
-
const
|
|
622
|
-
if (
|
|
836
|
+
const E = ct(x);
|
|
837
|
+
if (!E) return !1;
|
|
838
|
+
for (const T of r) {
|
|
839
|
+
const L = ct(T);
|
|
840
|
+
if (L && L === E || T === E)
|
|
623
841
|
return !0;
|
|
624
842
|
}
|
|
625
843
|
return !1;
|
|
626
844
|
}
|
|
627
|
-
function
|
|
628
|
-
var U, k,
|
|
629
|
-
if (((U =
|
|
630
|
-
((
|
|
845
|
+
function l(x) {
|
|
846
|
+
var U, k, _;
|
|
847
|
+
if (((U = x.data) == null ? void 0 : U.type) === "artifactuse" && (console.log("[Bridge] Message from:", x.origin, "action:", (k = x.data) == null ? void 0 : k.action), console.log("[Bridge] Allowed origins:", w())), !u(x.origin)) {
|
|
848
|
+
((_ = x.data) == null ? void 0 : _.type) === "artifactuse" && console.warn("[Bridge] Origin NOT allowed:", x.origin);
|
|
631
849
|
return;
|
|
632
850
|
}
|
|
633
|
-
const { type:
|
|
634
|
-
if (
|
|
635
|
-
if (
|
|
851
|
+
const { type: E, action: T, data: L, requestId: I } = x.data || {};
|
|
852
|
+
if (E !== "artifactuse") return;
|
|
853
|
+
if (T === "ready" || T === "panel:ready") {
|
|
636
854
|
console.log("[Bridge] panel:ready received, setting isReady=true"), n = !0, o = !0, m();
|
|
637
855
|
return;
|
|
638
856
|
}
|
|
639
|
-
(a.get(
|
|
857
|
+
(a.get(T) || []).forEach((R) => {
|
|
640
858
|
try {
|
|
641
|
-
L
|
|
642
|
-
} catch (
|
|
643
|
-
console.error(`Artifactuse bridge handler error (${
|
|
859
|
+
R(L, I);
|
|
860
|
+
} catch (A) {
|
|
861
|
+
console.error(`Artifactuse bridge handler error (${T}):`, A);
|
|
644
862
|
}
|
|
645
|
-
}), (a.get("*") || []).forEach((
|
|
863
|
+
}), (a.get("*") || []).forEach((R) => {
|
|
646
864
|
try {
|
|
647
|
-
|
|
648
|
-
} catch (
|
|
649
|
-
console.error("Artifactuse bridge wildcard handler error:",
|
|
865
|
+
R({ action: T, data: L, requestId: I });
|
|
866
|
+
} catch (A) {
|
|
867
|
+
console.error("Artifactuse bridge wildcard handler error:", A);
|
|
650
868
|
}
|
|
651
869
|
});
|
|
652
870
|
}
|
|
653
|
-
window.addEventListener("message",
|
|
654
|
-
function d(
|
|
655
|
-
|
|
871
|
+
window.addEventListener("message", l);
|
|
872
|
+
function d(x) {
|
|
873
|
+
x && typeof x == "string" && r.add(x);
|
|
656
874
|
}
|
|
657
|
-
function p(
|
|
658
|
-
|
|
875
|
+
function p(x) {
|
|
876
|
+
x && typeof x == "string" && r.delete(x);
|
|
659
877
|
}
|
|
660
878
|
function w() {
|
|
661
879
|
return [...r];
|
|
662
880
|
}
|
|
663
|
-
function
|
|
664
|
-
console.log("[Bridge] setIframe called, current isReady:", n, "readySignalReceived:", o, "same iframe:", s ===
|
|
881
|
+
function c(x) {
|
|
882
|
+
console.log("[Bridge] setIframe called, current isReady:", n, "readySignalReceived:", o, "same iframe:", s === x), s !== x && (s = x, o ? (console.log("[Bridge] Ready signal was already received, keeping isReady=true"), n = !0) : n = !1), console.log("[Bridge] setIframe done, isReady:", n, "pendingMessages:", i.length), m();
|
|
665
883
|
}
|
|
666
884
|
function m() {
|
|
667
|
-
console.log("[Bridge] flushPendingMessages: isReady=", n, "hasIframe=", !!(s != null && s.contentWindow), "pending=", i.length), n && (s != null && s.contentWindow) && i.length > 0 && (console.log("[Bridge] Flushing", i.length, "pending messages"), i.forEach((
|
|
885
|
+
console.log("[Bridge] flushPendingMessages: isReady=", n, "hasIframe=", !!(s != null && s.contentWindow), "pending=", i.length), n && (s != null && s.contentWindow) && i.length > 0 && (console.log("[Bridge] Flushing", i.length, "pending messages"), i.forEach((x) => h(x)), i.length = 0);
|
|
668
886
|
}
|
|
669
|
-
function h(
|
|
887
|
+
function h(x, E = "*") {
|
|
670
888
|
if (!(s != null && s.contentWindow))
|
|
671
889
|
return console.warn("Artifactuse: No panel iframe available"), !1;
|
|
672
890
|
try {
|
|
673
|
-
return s.contentWindow.postMessage(
|
|
674
|
-
} catch (
|
|
675
|
-
return console.error("Artifactuse bridge send error:",
|
|
891
|
+
return s.contentWindow.postMessage(x, E), !0;
|
|
892
|
+
} catch (T) {
|
|
893
|
+
return console.error("Artifactuse bridge send error:", T), !1;
|
|
676
894
|
}
|
|
677
895
|
}
|
|
678
|
-
function g(
|
|
679
|
-
const
|
|
896
|
+
function g(x, E, T = null, L = "*") {
|
|
897
|
+
const I = {
|
|
680
898
|
type: "artifactuse",
|
|
681
|
-
action:
|
|
682
|
-
data:
|
|
683
|
-
requestId:
|
|
899
|
+
action: x,
|
|
900
|
+
data: E,
|
|
901
|
+
requestId: T || ut(),
|
|
684
902
|
timestamp: Date.now()
|
|
685
903
|
};
|
|
686
|
-
return n ? (h(
|
|
687
|
-
}
|
|
688
|
-
function f(
|
|
689
|
-
return new Promise((
|
|
690
|
-
const
|
|
691
|
-
|
|
692
|
-
},
|
|
693
|
-
|
|
904
|
+
return n ? (h(I, L), I.requestId) : (i.push(I), I.requestId);
|
|
905
|
+
}
|
|
906
|
+
function f(x, E, T = 3e4) {
|
|
907
|
+
return new Promise((L, I) => {
|
|
908
|
+
const G = ut(), te = setTimeout(() => {
|
|
909
|
+
v(`${x}:response`, U), I(new Error(`Artifactuse bridge request timeout: ${x}`));
|
|
910
|
+
}, T), U = (k, _) => {
|
|
911
|
+
_ === G && (clearTimeout(te), v(`${x}:response`, U), L(k));
|
|
694
912
|
};
|
|
695
|
-
b(`${
|
|
913
|
+
b(`${x}:response`, U), g(x, E, G);
|
|
696
914
|
});
|
|
697
915
|
}
|
|
698
|
-
function b(
|
|
699
|
-
return a.has(
|
|
916
|
+
function b(x, E) {
|
|
917
|
+
return a.has(x) || a.set(x, []), a.get(x).push(E), () => v(x, E);
|
|
700
918
|
}
|
|
701
|
-
function
|
|
702
|
-
const
|
|
703
|
-
if (
|
|
704
|
-
const
|
|
705
|
-
|
|
919
|
+
function v(x, E) {
|
|
920
|
+
const T = a.get(x);
|
|
921
|
+
if (T) {
|
|
922
|
+
const L = T.indexOf(E);
|
|
923
|
+
L > -1 && T.splice(L, 1);
|
|
706
924
|
}
|
|
707
925
|
}
|
|
708
|
-
function
|
|
709
|
-
return g("load:artifact",
|
|
926
|
+
function M(x) {
|
|
927
|
+
return g("load:artifact", x);
|
|
710
928
|
}
|
|
711
|
-
function x
|
|
712
|
-
return g("update:artifact", { artifactId:
|
|
929
|
+
function $(x, E) {
|
|
930
|
+
return g("update:artifact", { artifactId: x, updates: E });
|
|
713
931
|
}
|
|
714
|
-
function
|
|
932
|
+
function z() {
|
|
715
933
|
return f("save", {});
|
|
716
934
|
}
|
|
717
|
-
function
|
|
718
|
-
return f("export", { format:
|
|
935
|
+
function S(x = "default") {
|
|
936
|
+
return f("export", { format: x });
|
|
719
937
|
}
|
|
720
|
-
function
|
|
721
|
-
return g("ai:response",
|
|
938
|
+
function y(x, E) {
|
|
939
|
+
return g("ai:response", x, E);
|
|
722
940
|
}
|
|
723
|
-
function
|
|
724
|
-
window.removeEventListener("message",
|
|
941
|
+
function C() {
|
|
942
|
+
window.removeEventListener("message", l), a.clear(), r.clear(), s = null, n = !1, o = !1, i.length = 0;
|
|
725
943
|
}
|
|
726
944
|
return {
|
|
727
|
-
setIframe:
|
|
945
|
+
setIframe: c,
|
|
728
946
|
send: g,
|
|
729
947
|
request: f,
|
|
730
948
|
on: b,
|
|
731
|
-
off:
|
|
732
|
-
loadArtifact:
|
|
733
|
-
updateArtifact:
|
|
734
|
-
requestSave:
|
|
735
|
-
requestExport:
|
|
736
|
-
sendAIResponse:
|
|
737
|
-
destroy:
|
|
949
|
+
off: v,
|
|
950
|
+
loadArtifact: M,
|
|
951
|
+
updateArtifact: $,
|
|
952
|
+
requestSave: z,
|
|
953
|
+
requestExport: S,
|
|
954
|
+
sendAIResponse: y,
|
|
955
|
+
destroy: C,
|
|
738
956
|
// Origin management
|
|
739
957
|
addAllowedOrigin: d,
|
|
740
958
|
removeAllowedOrigin: p,
|
|
@@ -865,16 +1083,16 @@ function na(e = "auto", t = {}) {
|
|
|
865
1083
|
}
|
|
866
1084
|
function i() {
|
|
867
1085
|
const m = o();
|
|
868
|
-
return Object.entries(m).map(([h, g]) => `--artifactuse-${
|
|
1086
|
+
return Object.entries(m).map(([h, g]) => `--artifactuse-${le(h)}: ${g};`).join(`
|
|
869
1087
|
`);
|
|
870
1088
|
}
|
|
871
1089
|
function u(m = document.documentElement) {
|
|
872
1090
|
const h = o(), g = n();
|
|
873
1091
|
Object.entries(h).forEach(([f, b]) => {
|
|
874
|
-
m.style.setProperty(`--artifactuse-${
|
|
1092
|
+
m.style.setProperty(`--artifactuse-${le(f)}`, b);
|
|
875
1093
|
}), m.setAttribute("data-artifactuse-theme", g), m.classList.remove("artifactuse-dark", "artifactuse-light"), m.classList.add(`artifactuse-${g}`);
|
|
876
1094
|
}
|
|
877
|
-
function
|
|
1095
|
+
function l(m) {
|
|
878
1096
|
if (!["dark", "light", "auto"].includes(m)) {
|
|
879
1097
|
console.warn(`Invalid theme: ${m}`);
|
|
880
1098
|
return;
|
|
@@ -883,7 +1101,7 @@ function na(e = "auto", t = {}) {
|
|
|
883
1101
|
}
|
|
884
1102
|
function d() {
|
|
885
1103
|
const m = n();
|
|
886
|
-
|
|
1104
|
+
l(m === "dark" ? "light" : "dark");
|
|
887
1105
|
}
|
|
888
1106
|
function p(m, h = null) {
|
|
889
1107
|
const g = ve(m);
|
|
@@ -897,22 +1115,22 @@ function na(e = "auto", t = {}) {
|
|
|
897
1115
|
h.removeEventListener("change", g);
|
|
898
1116
|
};
|
|
899
1117
|
}
|
|
900
|
-
function
|
|
1118
|
+
function c() {
|
|
901
1119
|
return `
|
|
902
1120
|
:root,
|
|
903
1121
|
[data-artifactuse-theme="dark"] {
|
|
904
|
-
${Object.entries(a.dark).map(([m, h]) => `--artifactuse-${
|
|
1122
|
+
${Object.entries(a.dark).map(([m, h]) => `--artifactuse-${le(m)}: ${h};`).join(`
|
|
905
1123
|
`)}
|
|
906
1124
|
}
|
|
907
1125
|
|
|
908
1126
|
[data-artifactuse-theme="light"] {
|
|
909
|
-
${Object.entries(a.light).map(([m, h]) => `--artifactuse-${
|
|
1127
|
+
${Object.entries(a.light).map(([m, h]) => `--artifactuse-${le(m)}: ${h};`).join(`
|
|
910
1128
|
`)}
|
|
911
1129
|
}
|
|
912
1130
|
|
|
913
1131
|
@media (prefers-color-scheme: light) {
|
|
914
1132
|
:root:not([data-artifactuse-theme]) {
|
|
915
|
-
${Object.entries(a.light).map(([m, h]) => `--artifactuse-${
|
|
1133
|
+
${Object.entries(a.light).map(([m, h]) => `--artifactuse-${le(m)}: ${h};`).join(`
|
|
916
1134
|
`)}
|
|
917
1135
|
}
|
|
918
1136
|
}
|
|
@@ -931,19 +1149,19 @@ function na(e = "auto", t = {}) {
|
|
|
931
1149
|
getResolvedTheme: n,
|
|
932
1150
|
getColors: o,
|
|
933
1151
|
getCSSVariables: i,
|
|
934
|
-
getCSS:
|
|
1152
|
+
getCSS: c,
|
|
935
1153
|
apply: u,
|
|
936
|
-
set:
|
|
1154
|
+
set: l,
|
|
937
1155
|
toggle: d,
|
|
938
1156
|
setColors: p,
|
|
939
1157
|
watchSystemTheme: w
|
|
940
1158
|
};
|
|
941
1159
|
}
|
|
942
|
-
function
|
|
1160
|
+
function le(e) {
|
|
943
1161
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
944
1162
|
}
|
|
945
1163
|
const Xe = "artifactuse_auth", gr = "https://app.artifactuse.com", ge = "https://api.artifactuse.com";
|
|
946
|
-
function
|
|
1164
|
+
function Le() {
|
|
947
1165
|
if (typeof window > "u" || !window.localStorage)
|
|
948
1166
|
return null;
|
|
949
1167
|
try {
|
|
@@ -978,8 +1196,8 @@ async function oa(e, t = {}) {
|
|
|
978
1196
|
}
|
|
979
1197
|
return a.json();
|
|
980
1198
|
}
|
|
981
|
-
async function
|
|
982
|
-
const { apiUrl: r = ge, getStoredAuthData: a =
|
|
1199
|
+
async function la(e, t = {}) {
|
|
1200
|
+
const { apiUrl: r = ge, getStoredAuthData: a = Le } = t, s = a();
|
|
983
1201
|
if (!(s != null && s.token))
|
|
984
1202
|
throw new Error("Authentication required. Please sign in first.");
|
|
985
1203
|
const n = await fetch(`${r}/v1/project/save`, {
|
|
@@ -1000,11 +1218,11 @@ async function ca(e, t = {}) {
|
|
|
1000
1218
|
}
|
|
1001
1219
|
return n.json();
|
|
1002
1220
|
}
|
|
1003
|
-
function
|
|
1221
|
+
function ca(e = {}) {
|
|
1004
1222
|
const {
|
|
1005
1223
|
appUrl: t = gr,
|
|
1006
1224
|
setStoredAuthData: r = ia,
|
|
1007
|
-
getStoredAuthData: a =
|
|
1225
|
+
getStoredAuthData: a = Le
|
|
1008
1226
|
} = e;
|
|
1009
1227
|
return new Promise((s, n) => {
|
|
1010
1228
|
const o = window.location.origin, i = `${t}/sdk/auth?origin=${encodeURIComponent(o)}`, u = window.open(
|
|
@@ -1016,18 +1234,18 @@ function la(e = {}) {
|
|
|
1016
1234
|
n(new Error("Failed to open auth popup. Please allow popups for this site."));
|
|
1017
1235
|
return;
|
|
1018
1236
|
}
|
|
1019
|
-
const
|
|
1237
|
+
const l = (p) => {
|
|
1020
1238
|
var w;
|
|
1021
1239
|
if (p.origin === t && ((w = p.data) == null ? void 0 : w.type) === "sdk-auth") {
|
|
1022
|
-
window.removeEventListener("message",
|
|
1023
|
-
const { token:
|
|
1024
|
-
|
|
1240
|
+
window.removeEventListener("message", l);
|
|
1241
|
+
const { token: c, user: m } = p.data;
|
|
1242
|
+
c ? (r({ token: c, user: m }), s({ token: c, user: m })) : n(new Error("Authentication failed"));
|
|
1025
1243
|
}
|
|
1026
1244
|
};
|
|
1027
|
-
window.addEventListener("message",
|
|
1245
|
+
window.addEventListener("message", l);
|
|
1028
1246
|
const d = setInterval(() => {
|
|
1029
1247
|
if (u.closed) {
|
|
1030
|
-
clearInterval(d), window.removeEventListener("message",
|
|
1248
|
+
clearInterval(d), window.removeEventListener("message", l);
|
|
1031
1249
|
const p = a();
|
|
1032
1250
|
p != null && p.token ? s(p) : n(new Error("Authentication cancelled"));
|
|
1033
1251
|
}
|
|
@@ -1035,7 +1253,7 @@ function la(e = {}) {
|
|
|
1035
1253
|
});
|
|
1036
1254
|
}
|
|
1037
1255
|
async function ua(e = {}) {
|
|
1038
|
-
const { apiUrl: t = ge, language: r, getStoredAuthData: a =
|
|
1256
|
+
const { apiUrl: t = ge, language: r, getStoredAuthData: a = Le } = e, s = a();
|
|
1039
1257
|
if (!(s != null && s.token))
|
|
1040
1258
|
throw new Error("Authentication required. Please sign in first.");
|
|
1041
1259
|
const n = new URLSearchParams();
|
|
@@ -1054,7 +1272,7 @@ async function ua(e = {}) {
|
|
|
1054
1272
|
return o.json();
|
|
1055
1273
|
}
|
|
1056
1274
|
async function da(e, t, r = {}) {
|
|
1057
|
-
const { apiUrl: a = ge, getStoredAuthData: s =
|
|
1275
|
+
const { apiUrl: a = ge, getStoredAuthData: s = Le } = r, n = s();
|
|
1058
1276
|
if (!(n != null && n.token))
|
|
1059
1277
|
throw new Error("Authentication required. Please sign in first.");
|
|
1060
1278
|
const o = await fetch(`${a}/v1/project/update`, {
|
|
@@ -1100,7 +1318,7 @@ function pa(e = {}) {
|
|
|
1100
1318
|
} catch {
|
|
1101
1319
|
}
|
|
1102
1320
|
}
|
|
1103
|
-
function
|
|
1321
|
+
function l() {
|
|
1104
1322
|
if (!(typeof window > "u" || !window.localStorage))
|
|
1105
1323
|
try {
|
|
1106
1324
|
localStorage.removeItem(a);
|
|
@@ -1124,14 +1342,14 @@ function pa(e = {}) {
|
|
|
1124
1342
|
},
|
|
1125
1343
|
getStoredAuthData: i,
|
|
1126
1344
|
setStoredAuthData: u,
|
|
1127
|
-
clearStoredAuthData:
|
|
1128
|
-
signOut:
|
|
1345
|
+
clearStoredAuthData: l,
|
|
1346
|
+
signOut: l,
|
|
1129
1347
|
// API methods
|
|
1130
1348
|
share: (d) => oa(d, { apiUrl: t }),
|
|
1131
|
-
save: (d) =>
|
|
1349
|
+
save: (d) => la(d, { apiUrl: t, getStoredAuthData: i }),
|
|
1132
1350
|
listArtifacts: (d) => ua({ apiUrl: t, language: d, getStoredAuthData: i }),
|
|
1133
1351
|
updateArtifact: (d, p) => da(d, p, { apiUrl: t, getStoredAuthData: i }),
|
|
1134
|
-
openAuthPopup: () =>
|
|
1352
|
+
openAuthPopup: () => ca({ appUrl: r, setStoredAuthData: u, getStoredAuthData: i })
|
|
1135
1353
|
};
|
|
1136
1354
|
}
|
|
1137
1355
|
function fa(e = {}) {
|
|
@@ -1287,61 +1505,61 @@ function fa(e = {}) {
|
|
|
1287
1505
|
}
|
|
1288
1506
|
}, { dark: !1 });
|
|
1289
1507
|
}
|
|
1290
|
-
function o(w,
|
|
1508
|
+
function o(w, c, m) {
|
|
1291
1509
|
return m ? w.define([
|
|
1292
|
-
{ tag:
|
|
1293
|
-
{ tag:
|
|
1294
|
-
{ tag:
|
|
1295
|
-
{ tag:
|
|
1296
|
-
{ tag:
|
|
1297
|
-
{ tag:
|
|
1298
|
-
{ tag:
|
|
1299
|
-
{ tag:
|
|
1300
|
-
{ tag:
|
|
1301
|
-
{ tag:
|
|
1302
|
-
{ tag:
|
|
1303
|
-
{ tag:
|
|
1304
|
-
{ tag:
|
|
1305
|
-
{ tag:
|
|
1306
|
-
{ tag:
|
|
1307
|
-
{ tag:
|
|
1308
|
-
{ tag:
|
|
1309
|
-
{ tag:
|
|
1310
|
-
{ tag:
|
|
1311
|
-
{ tag:
|
|
1312
|
-
{ tag:
|
|
1313
|
-
{ tag:
|
|
1314
|
-
{ tag:
|
|
1315
|
-
{ tag:
|
|
1316
|
-
{ tag:
|
|
1317
|
-
{ tag:
|
|
1510
|
+
{ tag: c.keyword, color: "#c084fc" },
|
|
1511
|
+
{ tag: c.operator, color: "#94a3b8" },
|
|
1512
|
+
{ tag: c.special(c.variableName), color: "#67e8f9" },
|
|
1513
|
+
{ tag: c.typeName, color: "#fbbf24" },
|
|
1514
|
+
{ tag: c.atom, color: "#fb923c" },
|
|
1515
|
+
{ tag: c.number, color: "#fb923c" },
|
|
1516
|
+
{ tag: c.definition(c.variableName), color: "#67e8f9" },
|
|
1517
|
+
{ tag: c.string, color: "#86efac" },
|
|
1518
|
+
{ tag: c.special(c.string), color: "#86efac" },
|
|
1519
|
+
{ tag: c.comment, color: "#6b7280", fontStyle: "italic" },
|
|
1520
|
+
{ tag: c.variableName, color: "#e4e4e7" },
|
|
1521
|
+
{ tag: c.tagName, color: "#f87171" },
|
|
1522
|
+
{ tag: c.bracket, color: "#a1a1aa" },
|
|
1523
|
+
{ tag: c.meta, color: "#fbbf24" },
|
|
1524
|
+
{ tag: c.link, color: "#60a5fa", textDecoration: "underline" },
|
|
1525
|
+
{ tag: c.heading, fontWeight: "bold", color: "#f472b6" },
|
|
1526
|
+
{ tag: c.emphasis, fontStyle: "italic" },
|
|
1527
|
+
{ tag: c.strong, fontWeight: "bold" },
|
|
1528
|
+
{ tag: c.strikethrough, textDecoration: "line-through" },
|
|
1529
|
+
{ tag: c.className, color: "#fbbf24" },
|
|
1530
|
+
{ tag: c.propertyName, color: "#60a5fa" },
|
|
1531
|
+
{ tag: c.function(c.variableName), color: "#60a5fa" },
|
|
1532
|
+
{ tag: c.function(c.propertyName), color: "#60a5fa" },
|
|
1533
|
+
{ tag: c.bool, color: "#fb923c" },
|
|
1534
|
+
{ tag: c.null, color: "#fb923c" },
|
|
1535
|
+
{ tag: c.regexp, color: "#f87171" }
|
|
1318
1536
|
]) : w.define([
|
|
1319
|
-
{ tag:
|
|
1320
|
-
{ tag:
|
|
1321
|
-
{ tag:
|
|
1322
|
-
{ tag:
|
|
1323
|
-
{ tag:
|
|
1324
|
-
{ tag:
|
|
1325
|
-
{ tag:
|
|
1326
|
-
{ tag:
|
|
1327
|
-
{ tag:
|
|
1328
|
-
{ tag:
|
|
1329
|
-
{ tag:
|
|
1330
|
-
{ tag:
|
|
1331
|
-
{ tag:
|
|
1332
|
-
{ tag:
|
|
1333
|
-
{ tag:
|
|
1334
|
-
{ tag:
|
|
1335
|
-
{ tag:
|
|
1336
|
-
{ tag:
|
|
1337
|
-
{ tag:
|
|
1338
|
-
{ tag:
|
|
1339
|
-
{ tag:
|
|
1340
|
-
{ tag:
|
|
1341
|
-
{ tag:
|
|
1342
|
-
{ tag:
|
|
1343
|
-
{ tag:
|
|
1344
|
-
{ tag:
|
|
1537
|
+
{ tag: c.keyword, color: "#7c3aed" },
|
|
1538
|
+
{ tag: c.operator, color: "#64748b" },
|
|
1539
|
+
{ tag: c.special(c.variableName), color: "#0891b2" },
|
|
1540
|
+
{ tag: c.typeName, color: "#d97706" },
|
|
1541
|
+
{ tag: c.atom, color: "#ea580c" },
|
|
1542
|
+
{ tag: c.number, color: "#ea580c" },
|
|
1543
|
+
{ tag: c.definition(c.variableName), color: "#0891b2" },
|
|
1544
|
+
{ tag: c.string, color: "#16a34a" },
|
|
1545
|
+
{ tag: c.special(c.string), color: "#16a34a" },
|
|
1546
|
+
{ tag: c.comment, color: "#9ca3af", fontStyle: "italic" },
|
|
1547
|
+
{ tag: c.variableName, color: "#27272a" },
|
|
1548
|
+
{ tag: c.tagName, color: "#dc2626" },
|
|
1549
|
+
{ tag: c.bracket, color: "#71717a" },
|
|
1550
|
+
{ tag: c.meta, color: "#d97706" },
|
|
1551
|
+
{ tag: c.link, color: "#2563eb", textDecoration: "underline" },
|
|
1552
|
+
{ tag: c.heading, fontWeight: "bold", color: "#db2777" },
|
|
1553
|
+
{ tag: c.emphasis, fontStyle: "italic" },
|
|
1554
|
+
{ tag: c.strong, fontWeight: "bold" },
|
|
1555
|
+
{ tag: c.strikethrough, textDecoration: "line-through" },
|
|
1556
|
+
{ tag: c.className, color: "#d97706" },
|
|
1557
|
+
{ tag: c.propertyName, color: "#2563eb" },
|
|
1558
|
+
{ tag: c.function(c.variableName), color: "#2563eb" },
|
|
1559
|
+
{ tag: c.function(c.propertyName), color: "#2563eb" },
|
|
1560
|
+
{ tag: c.bool, color: "#ea580c" },
|
|
1561
|
+
{ tag: c.null, color: "#ea580c" },
|
|
1562
|
+
{ tag: c.regexp, color: "#dc2626" }
|
|
1345
1563
|
]);
|
|
1346
1564
|
}
|
|
1347
1565
|
const i = {
|
|
@@ -1379,15 +1597,15 @@ function fa(e = {}) {
|
|
|
1379
1597
|
scss: { mod: "langSass", fn: "sass" }
|
|
1380
1598
|
};
|
|
1381
1599
|
function u(w) {
|
|
1382
|
-
const
|
|
1383
|
-
if (!
|
|
1384
|
-
const m = t[
|
|
1385
|
-
return !m || typeof m[
|
|
1600
|
+
const c = i[w == null ? void 0 : w.toLowerCase()];
|
|
1601
|
+
if (!c) return [];
|
|
1602
|
+
const m = t[c.mod];
|
|
1603
|
+
return !m || typeof m[c.fn] != "function" ? [] : c.opts ? m[c.fn](c.opts) : m[c.fn]();
|
|
1386
1604
|
}
|
|
1387
|
-
function
|
|
1605
|
+
function l(w) {
|
|
1388
1606
|
return r === "auto" ? w === "dark" : r === "dark";
|
|
1389
1607
|
}
|
|
1390
|
-
function d(w,
|
|
1608
|
+
function d(w, c = {}) {
|
|
1391
1609
|
var be, ie;
|
|
1392
1610
|
if (!a())
|
|
1393
1611
|
return console.warn("Artifactuse: CodeMirror modules not provided. Editor not available."), null;
|
|
@@ -1396,62 +1614,62 @@ function fa(e = {}) {
|
|
|
1396
1614
|
keymap: g,
|
|
1397
1615
|
lineNumbers: f,
|
|
1398
1616
|
highlightActiveLineGutter: b,
|
|
1399
|
-
highlightSpecialChars:
|
|
1400
|
-
drawSelection:
|
|
1401
|
-
dropCursor:
|
|
1402
|
-
rectangularSelection:
|
|
1403
|
-
crosshairCursor:
|
|
1404
|
-
highlightActiveLine:
|
|
1405
|
-
} = t.view, { defaultKeymap:
|
|
1406
|
-
indentOnInput:
|
|
1407
|
-
syntaxHighlighting:
|
|
1408
|
-
bracketMatching:
|
|
1617
|
+
highlightSpecialChars: v,
|
|
1618
|
+
drawSelection: M,
|
|
1619
|
+
dropCursor: $,
|
|
1620
|
+
rectangularSelection: z,
|
|
1621
|
+
crosshairCursor: S,
|
|
1622
|
+
highlightActiveLine: y
|
|
1623
|
+
} = t.view, { defaultKeymap: C, history: x, historyKeymap: E, indentWithTab: T } = t.commands, {
|
|
1624
|
+
indentOnInput: L,
|
|
1625
|
+
syntaxHighlighting: I,
|
|
1626
|
+
bracketMatching: G,
|
|
1409
1627
|
foldGutter: te,
|
|
1410
1628
|
foldKeymap: U,
|
|
1411
1629
|
HighlightStyle: k
|
|
1412
1630
|
} = t.language, {
|
|
1413
|
-
closeBrackets:
|
|
1414
|
-
closeBracketsKeymap:
|
|
1415
|
-
autocompletion:
|
|
1631
|
+
closeBrackets: _,
|
|
1632
|
+
closeBracketsKeymap: R,
|
|
1633
|
+
autocompletion: A,
|
|
1416
1634
|
completionKeymap: D
|
|
1417
|
-
} = t.autocomplete,
|
|
1635
|
+
} = t.autocomplete, P = ((be = t.lezerHighlight) == null ? void 0 : be.tags) || ((ie = t.language) == null ? void 0 : ie.tags), Z = l(c.sdkTheme), ne = Z ? s(h) : n(h), re = [
|
|
1418
1636
|
f(),
|
|
1419
1637
|
b(),
|
|
1420
|
-
|
|
1421
|
-
|
|
1638
|
+
v(),
|
|
1639
|
+
x(),
|
|
1422
1640
|
te({
|
|
1423
1641
|
openText: "▾",
|
|
1424
1642
|
closedText: "▸"
|
|
1425
1643
|
}),
|
|
1426
|
-
|
|
1427
|
-
|
|
1644
|
+
M(),
|
|
1645
|
+
$(),
|
|
1428
1646
|
m.allowMultipleSelections.of(!0),
|
|
1647
|
+
L(),
|
|
1648
|
+
...P ? [I(o(k, P, Z))] : [],
|
|
1649
|
+
G(),
|
|
1429
1650
|
_(),
|
|
1430
|
-
|
|
1431
|
-
X(),
|
|
1432
|
-
C(),
|
|
1433
|
-
S(),
|
|
1434
|
-
$(),
|
|
1435
|
-
R(),
|
|
1651
|
+
A(),
|
|
1436
1652
|
z(),
|
|
1653
|
+
S(),
|
|
1654
|
+
y(),
|
|
1437
1655
|
g.of([
|
|
1438
|
-
...
|
|
1439
|
-
...
|
|
1440
|
-
...
|
|
1656
|
+
...R,
|
|
1657
|
+
...C,
|
|
1658
|
+
...E,
|
|
1441
1659
|
...U,
|
|
1442
1660
|
...D,
|
|
1443
|
-
|
|
1661
|
+
T
|
|
1444
1662
|
]),
|
|
1445
|
-
u(
|
|
1663
|
+
u(c.language),
|
|
1446
1664
|
ne
|
|
1447
1665
|
];
|
|
1448
|
-
|
|
1666
|
+
c.onChange && re.push(
|
|
1449
1667
|
h.updateListener.of((oe) => {
|
|
1450
|
-
oe.docChanged &&
|
|
1668
|
+
oe.docChanged && c.onChange(oe.state.doc.toString());
|
|
1451
1669
|
})
|
|
1452
1670
|
);
|
|
1453
1671
|
const ae = m.create({
|
|
1454
|
-
doc:
|
|
1672
|
+
doc: c.code || "",
|
|
1455
1673
|
extensions: re
|
|
1456
1674
|
}), O = new h({
|
|
1457
1675
|
state: ae,
|
|
@@ -1490,7 +1708,7 @@ function mr(e) {
|
|
|
1490
1708
|
ee = e;
|
|
1491
1709
|
}
|
|
1492
1710
|
var he = { exec: () => null };
|
|
1493
|
-
function
|
|
1711
|
+
function j(e, t = "") {
|
|
1494
1712
|
let r = typeof e == "string" ? e : e.source, a = { replace: (s, n) => {
|
|
1495
1713
|
let o = typeof n == "string" ? n : n.source;
|
|
1496
1714
|
return o = o.replace(q.caret, "$1"), r = r.replace(s, o), a;
|
|
@@ -1503,9 +1721,9 @@ var ha = (() => {
|
|
|
1503
1721
|
} catch {
|
|
1504
1722
|
return !1;
|
|
1505
1723
|
}
|
|
1506
|
-
})(), q = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (e) => new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}#`), htmlBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i") }, ga = /^(?:[ \t]*(?:\n|$))+/, ma = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, wa = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, me = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ba = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Je = /(?:[*+-]|\d{1,9}[.)])/, wr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, br =
|
|
1507
|
-
]`).replace("lheading", br).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() },
|
|
1508
|
-
function
|
|
1724
|
+
})(), q = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (e) => new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}#`), htmlBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i") }, ga = /^(?:[ \t]*(?:\n|$))+/, ma = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, wa = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, me = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ba = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Je = /(?:[*+-]|\d{1,9}[.)])/, wr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, br = j(wr).replace(/bull/g, Je).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), va = j(wr).replace(/bull/g, Je).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Qe = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ya = /^[^\n]+/, Ye = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ka = j(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Ye).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), xa = j(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Je).getRegex(), Te = "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]*?(?:-->|$))/, Ma = j("^ {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", Te).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), vr = j(Qe).replace("hr", me).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Te).getRegex(), $a = j(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", vr).getRegex(), tt = { blockquote: $a, code: ma, def: ka, fences: wa, heading: ba, hr: me, html: Ma, lheading: br, list: xa, newline: ga, paragraph: vr, table: he, text: ya }, pt = j("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", me).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Te).getRegex(), za = { ...tt, lheading: va, table: pt, paragraph: j(Qe).replace("hr", me).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", pt).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Te).getRegex() }, Aa = { ...tt, html: j(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", et).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: he, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: j(Qe).replace("hr", me).replace("heading", ` *#{1,6} *[^
|
|
1725
|
+
]`).replace("lheading", br).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Sa = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ca = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, yr = /^( {2,}|\\)\n(?!\s*$)/, Ra = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, _e = /[\p{P}\p{S}]/u, rt = /[\s\p{P}\p{S}]/u, kr = /[^\s\p{P}\p{S}]/u, La = j(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, rt).getRegex(), xr = /(?!~)[\p{P}\p{S}]/u, Ta = /(?!~)[\s\p{P}\p{S}]/u, _a = /(?:[^\s\p{P}\p{S}]|~)/u, Ea = j(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", ha ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Mr = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Pa = j(Mr, "u").replace(/punct/g, _e).getRegex(), ja = j(Mr, "u").replace(/punct/g, xr).getRegex(), $r = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ha = j($r, "gu").replace(/notPunctSpace/g, kr).replace(/punctSpace/g, rt).replace(/punct/g, _e).getRegex(), Va = j($r, "gu").replace(/notPunctSpace/g, _a).replace(/punctSpace/g, Ta).replace(/punct/g, xr).getRegex(), Ia = j("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, kr).replace(/punctSpace/g, rt).replace(/punct/g, _e).getRegex(), Da = j(/\\(punct)/, "gu").replace(/punct/g, _e).getRegex(), qa = j(/^<(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(), Za = j(et).replace("(?:-->|$)", "-->").getRegex(), Oa = j("^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", Za).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), $e = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ba = j(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", $e).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), zr = j(/^!?\[(label)\]\[(ref)\]/).replace("label", $e).replace("ref", Ye).getRegex(), Ar = j(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ye).getRegex(), Fa = j("reflink|nolink(?!\\()", "g").replace("reflink", zr).replace("nolink", Ar).getRegex(), ft = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, at = { _backpedal: he, anyPunctuation: Da, autolink: qa, blockSkip: Ea, br: yr, code: Ca, del: he, emStrongLDelim: Pa, emStrongRDelimAst: Ha, emStrongRDelimUnd: Ia, escape: Sa, link: Ba, nolink: Ar, punctuation: La, reflink: zr, reflinkSearch: Fa, tag: Oa, text: Ra, url: he }, Na = { ...at, link: j(/^!?\[(label)\]\((.*?)\)/).replace("label", $e).getRegex(), reflink: j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", $e).getRegex() }, Ve = { ...at, emStrongRDelimAst: Va, emStrongLDelim: ja, url: j(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ft).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: j(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ft).getRegex() }, Ua = { ...Ve, br: j(yr).replace("{2,}", "*").getRegex(), text: j(Ve.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, ye = { normal: tt, gfm: za, pedantic: Aa }, ce = { normal: at, gfm: Ve, breaks: Ua, pedantic: Na }, Ga = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ht = (e) => Ga[e];
|
|
1726
|
+
function W(e, t) {
|
|
1509
1727
|
if (t) {
|
|
1510
1728
|
if (q.escapeTest.test(e)) return e.replace(q.escapeReplace, ht);
|
|
1511
1729
|
} else if (q.escapeTestNoEncode.test(e)) return e.replace(q.escapeReplaceNoEncode, ht);
|
|
@@ -1522,9 +1740,9 @@ function gt(e) {
|
|
|
1522
1740
|
function mt(e, t) {
|
|
1523
1741
|
var n;
|
|
1524
1742
|
let r = e.replace(q.findPipe, (o, i, u) => {
|
|
1525
|
-
let
|
|
1526
|
-
for (; --d >= 0 && u[d] === "\\"; )
|
|
1527
|
-
return
|
|
1743
|
+
let l = !1, d = i;
|
|
1744
|
+
for (; --d >= 0 && u[d] === "\\"; ) l = !l;
|
|
1745
|
+
return l ? "|" : " |";
|
|
1528
1746
|
}), a = r.split(q.splitPipe), s = 0;
|
|
1529
1747
|
if (a[0].trim() || a.shift(), a.length > 0 && !((n = a.at(-1)) != null && n.trim()) && a.pop(), t) if (a.length > t) a.splice(t);
|
|
1530
1748
|
else for (; a.length < t; ) a.push("");
|
|
@@ -1566,11 +1784,11 @@ function Xa(e, t, r) {
|
|
|
1566
1784
|
}).join(`
|
|
1567
1785
|
`);
|
|
1568
1786
|
}
|
|
1569
|
-
var
|
|
1787
|
+
var ze = class {
|
|
1570
1788
|
constructor(e) {
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1789
|
+
V(this, "options");
|
|
1790
|
+
V(this, "rules");
|
|
1791
|
+
V(this, "lexer");
|
|
1574
1792
|
this.options = e || ee;
|
|
1575
1793
|
}
|
|
1576
1794
|
space(e) {
|
|
@@ -1620,27 +1838,27 @@ var Se = class {
|
|
|
1620
1838
|
else if (!o) i.push(r[u]);
|
|
1621
1839
|
else break;
|
|
1622
1840
|
r = r.slice(u);
|
|
1623
|
-
let
|
|
1624
|
-
`), d =
|
|
1841
|
+
let l = i.join(`
|
|
1842
|
+
`), d = l.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1625
1843
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1626
1844
|
a = a ? `${a}
|
|
1627
|
-
${
|
|
1845
|
+
${l}` : l, s = s ? `${s}
|
|
1628
1846
|
${d}` : d;
|
|
1629
1847
|
let p = this.lexer.state.top;
|
|
1630
1848
|
if (this.lexer.state.top = !0, this.lexer.blockTokens(d, n, !0), this.lexer.state.top = p, r.length === 0) break;
|
|
1631
1849
|
let w = n.at(-1);
|
|
1632
1850
|
if ((w == null ? void 0 : w.type) === "code") break;
|
|
1633
1851
|
if ((w == null ? void 0 : w.type) === "blockquote") {
|
|
1634
|
-
let
|
|
1852
|
+
let c = w, m = c.raw + `
|
|
1635
1853
|
` + r.join(`
|
|
1636
1854
|
`), h = this.blockquote(m);
|
|
1637
|
-
n[n.length - 1] = h, a = a.substring(0, a.length -
|
|
1855
|
+
n[n.length - 1] = h, a = a.substring(0, a.length - c.raw.length) + h.raw, s = s.substring(0, s.length - c.text.length) + h.text;
|
|
1638
1856
|
break;
|
|
1639
1857
|
} else if ((w == null ? void 0 : w.type) === "list") {
|
|
1640
|
-
let
|
|
1858
|
+
let c = w, m = c.raw + `
|
|
1641
1859
|
` + r.join(`
|
|
1642
1860
|
`), h = this.list(m);
|
|
1643
|
-
n[n.length - 1] = h, a = a.substring(0, a.length - w.raw.length) + h.raw, s = s.substring(0, s.length -
|
|
1861
|
+
n[n.length - 1] = h, a = a.substring(0, a.length - w.raw.length) + h.raw, s = s.substring(0, s.length - c.raw.length) + h.raw, r = m.substring(n.at(-1).raw.length).split(`
|
|
1644
1862
|
`);
|
|
1645
1863
|
continue;
|
|
1646
1864
|
}
|
|
@@ -1659,31 +1877,31 @@ ${d}` : d;
|
|
|
1659
1877
|
let d = !1, p = "", w = "";
|
|
1660
1878
|
if (!(t = i.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
1661
1879
|
p = t[0], e = e.substring(p.length);
|
|
1662
|
-
let
|
|
1880
|
+
let c = t[2].split(`
|
|
1663
1881
|
`, 1)[0].replace(this.rules.other.listReplaceTabs, (f) => " ".repeat(3 * f.length)), m = e.split(`
|
|
1664
|
-
`, 1)[0], h = !
|
|
1665
|
-
if (this.options.pedantic ? (g = 2, w =
|
|
1882
|
+
`, 1)[0], h = !c.trim(), g = 0;
|
|
1883
|
+
if (this.options.pedantic ? (g = 2, w = c.trimStart()) : h ? g = t[1].length + 1 : (g = t[2].search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, w = c.slice(g), g += t[1].length), h && this.rules.other.blankLine.test(m) && (p += m + `
|
|
1666
1884
|
`, e = e.substring(m.length + 1), d = !0), !d) {
|
|
1667
|
-
let f = this.rules.other.nextBulletRegex(g), b = this.rules.other.hrRegex(g),
|
|
1885
|
+
let f = this.rules.other.nextBulletRegex(g), b = this.rules.other.hrRegex(g), v = this.rules.other.fencesBeginRegex(g), M = this.rules.other.headingBeginRegex(g), $ = this.rules.other.htmlBeginRegex(g);
|
|
1668
1886
|
for (; e; ) {
|
|
1669
|
-
let
|
|
1670
|
-
`, 1)[0],
|
|
1671
|
-
if (m =
|
|
1672
|
-
if (
|
|
1673
|
-
` +
|
|
1887
|
+
let z = e.split(`
|
|
1888
|
+
`, 1)[0], S;
|
|
1889
|
+
if (m = z, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), S = m) : S = m.replace(this.rules.other.tabCharGlobal, " "), v.test(m) || M.test(m) || $.test(m) || f.test(m) || b.test(m)) break;
|
|
1890
|
+
if (S.search(this.rules.other.nonSpaceChar) >= g || !m.trim()) w += `
|
|
1891
|
+
` + S.slice(g);
|
|
1674
1892
|
else {
|
|
1675
|
-
if (h ||
|
|
1893
|
+
if (h || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || v.test(c) || M.test(c) || b.test(c)) break;
|
|
1676
1894
|
w += `
|
|
1677
1895
|
` + m;
|
|
1678
1896
|
}
|
|
1679
|
-
!h && !m.trim() && (h = !0), p +=
|
|
1680
|
-
`, e = e.substring(
|
|
1897
|
+
!h && !m.trim() && (h = !0), p += z + `
|
|
1898
|
+
`, e = e.substring(z.length + 1), c = S.slice(g);
|
|
1681
1899
|
}
|
|
1682
1900
|
}
|
|
1683
1901
|
o.loose || (u ? o.loose = !0 : this.rules.other.doubleBlankLine.test(p) && (u = !0)), o.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(w), loose: !1, text: w, tokens: [] }), o.raw += p;
|
|
1684
1902
|
}
|
|
1685
|
-
let
|
|
1686
|
-
if (
|
|
1903
|
+
let l = o.items.at(-1);
|
|
1904
|
+
if (l) l.raw = l.raw.trimEnd(), l.text = l.text.trimEnd();
|
|
1687
1905
|
else return;
|
|
1688
1906
|
o.raw = o.raw.trimEnd();
|
|
1689
1907
|
for (let d of o.items) {
|
|
@@ -1702,7 +1920,7 @@ ${d}` : d;
|
|
|
1702
1920
|
}
|
|
1703
1921
|
}
|
|
1704
1922
|
if (!o.loose) {
|
|
1705
|
-
let p = d.tokens.filter((
|
|
1923
|
+
let p = d.tokens.filter((c) => c.type === "space"), w = p.length > 0 && p.some((c) => this.rules.other.anyLine.test(c.raw));
|
|
1706
1924
|
o.loose = w;
|
|
1707
1925
|
}
|
|
1708
1926
|
}
|
|
@@ -1733,7 +1951,7 @@ ${d}` : d;
|
|
|
1733
1951
|
if (r.length === a.length) {
|
|
1734
1952
|
for (let i of a) this.rules.other.tableAlignRight.test(i) ? n.align.push("right") : this.rules.other.tableAlignCenter.test(i) ? n.align.push("center") : this.rules.other.tableAlignLeft.test(i) ? n.align.push("left") : n.align.push(null);
|
|
1735
1953
|
for (let i = 0; i < r.length; i++) n.header.push({ text: r[i], tokens: this.lexer.inline(r[i]), header: !0, align: n.align[i] });
|
|
1736
|
-
for (let i of s) n.rows.push(mt(i, n.header.length).map((u,
|
|
1954
|
+
for (let i of s) n.rows.push(mt(i, n.header.length).map((u, l) => ({ text: u, tokens: this.lexer.inline(u), header: !1, align: n.align[l] })));
|
|
1737
1955
|
return n;
|
|
1738
1956
|
}
|
|
1739
1957
|
}
|
|
@@ -1799,8 +2017,8 @@ ${d}` : d;
|
|
|
1799
2017
|
emStrong(e, t, r = "") {
|
|
1800
2018
|
let a = this.rules.inline.emStrongLDelim.exec(e);
|
|
1801
2019
|
if (!(!a || a[3] && r.match(this.rules.other.unicodeAlphaNumeric)) && (!(a[1] || a[2]) || !r || this.rules.inline.punctuation.exec(r))) {
|
|
1802
|
-
let s = [...a[0]].length - 1, n, o, i = s, u = 0,
|
|
1803
|
-
for (
|
|
2020
|
+
let s = [...a[0]].length - 1, n, o, i = s, u = 0, l = a[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
2021
|
+
for (l.lastIndex = 0, t = t.slice(-1 * e.length + s); (a = l.exec(t)) != null; ) {
|
|
1804
2022
|
if (n = a[1] || a[2] || a[3] || a[4] || a[5] || a[6], !n) continue;
|
|
1805
2023
|
if (o = [...n].length, a[3] || a[4]) {
|
|
1806
2024
|
i += o;
|
|
@@ -1813,8 +2031,8 @@ ${d}` : d;
|
|
|
1813
2031
|
o = Math.min(o, o + i + u);
|
|
1814
2032
|
let d = [...a[0]][0].length, p = e.slice(0, s + a.index + d + o);
|
|
1815
2033
|
if (Math.min(s, o) % 2) {
|
|
1816
|
-
let
|
|
1817
|
-
return { type: "em", raw: p, text:
|
|
2034
|
+
let c = p.slice(1, -1);
|
|
2035
|
+
return { type: "em", raw: p, text: c, tokens: this.lexer.inlineTokens(c) };
|
|
1818
2036
|
}
|
|
1819
2037
|
let w = p.slice(2, -2);
|
|
1820
2038
|
return { type: "strong", raw: p, text: w, tokens: this.lexer.inlineTokens(w) };
|
|
@@ -1866,25 +2084,25 @@ ${d}` : d;
|
|
|
1866
2084
|
return { type: "text", raw: t[0], text: t[0], escaped: r };
|
|
1867
2085
|
}
|
|
1868
2086
|
}
|
|
1869
|
-
}, F = class
|
|
2087
|
+
}, F = class Ie {
|
|
1870
2088
|
constructor(t) {
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || ee, this.options.tokenizer = this.options.tokenizer || new
|
|
1877
|
-
let r = { other: q, block: ye.normal, inline:
|
|
1878
|
-
this.options.pedantic ? (r.block = ye.pedantic, r.inline =
|
|
2089
|
+
V(this, "tokens");
|
|
2090
|
+
V(this, "options");
|
|
2091
|
+
V(this, "state");
|
|
2092
|
+
V(this, "inlineQueue");
|
|
2093
|
+
V(this, "tokenizer");
|
|
2094
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || ee, this.options.tokenizer = this.options.tokenizer || new ze(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
2095
|
+
let r = { other: q, block: ye.normal, inline: ce.normal };
|
|
2096
|
+
this.options.pedantic ? (r.block = ye.pedantic, r.inline = ce.pedantic) : this.options.gfm && (r.block = ye.gfm, this.options.breaks ? r.inline = ce.breaks : r.inline = ce.gfm), this.tokenizer.rules = r;
|
|
1879
2097
|
}
|
|
1880
2098
|
static get rules() {
|
|
1881
|
-
return { block: ye, inline:
|
|
2099
|
+
return { block: ye, inline: ce };
|
|
1882
2100
|
}
|
|
1883
2101
|
static lex(t, r) {
|
|
1884
|
-
return new
|
|
2102
|
+
return new Ie(r).lex(t);
|
|
1885
2103
|
}
|
|
1886
2104
|
static lexInline(t, r) {
|
|
1887
|
-
return new
|
|
2105
|
+
return new Ie(r).inlineTokens(t);
|
|
1888
2106
|
}
|
|
1889
2107
|
lex(t) {
|
|
1890
2108
|
t = t.replace(q.carriageReturn, `
|
|
@@ -1899,21 +2117,21 @@ ${d}` : d;
|
|
|
1899
2117
|
var s, n, o;
|
|
1900
2118
|
for (this.options.pedantic && (t = t.replace(q.tabCharGlobal, " ").replace(q.spaceLine, "")); t; ) {
|
|
1901
2119
|
let i;
|
|
1902
|
-
if ((n = (s = this.options.extensions) == null ? void 0 : s.block) != null && n.some((
|
|
2120
|
+
if ((n = (s = this.options.extensions) == null ? void 0 : s.block) != null && n.some((l) => (i = l.call({ lexer: this }, t, r)) ? (t = t.substring(i.raw.length), r.push(i), !0) : !1)) continue;
|
|
1903
2121
|
if (i = this.tokenizer.space(t)) {
|
|
1904
2122
|
t = t.substring(i.raw.length);
|
|
1905
|
-
let
|
|
1906
|
-
i.raw.length === 1 &&
|
|
2123
|
+
let l = r.at(-1);
|
|
2124
|
+
i.raw.length === 1 && l !== void 0 ? l.raw += `
|
|
1907
2125
|
` : r.push(i);
|
|
1908
2126
|
continue;
|
|
1909
2127
|
}
|
|
1910
2128
|
if (i = this.tokenizer.code(t)) {
|
|
1911
2129
|
t = t.substring(i.raw.length);
|
|
1912
|
-
let
|
|
1913
|
-
(
|
|
2130
|
+
let l = r.at(-1);
|
|
2131
|
+
(l == null ? void 0 : l.type) === "paragraph" || (l == null ? void 0 : l.type) === "text" ? (l.raw += (l.raw.endsWith(`
|
|
1914
2132
|
`) ? "" : `
|
|
1915
|
-
`) + i.raw,
|
|
1916
|
-
` + i.text, this.inlineQueue.at(-1).src =
|
|
2133
|
+
`) + i.raw, l.text += `
|
|
2134
|
+
` + i.text, this.inlineQueue.at(-1).src = l.text) : r.push(i);
|
|
1917
2135
|
continue;
|
|
1918
2136
|
}
|
|
1919
2137
|
if (i = this.tokenizer.fences(t)) {
|
|
@@ -1942,11 +2160,11 @@ ${d}` : d;
|
|
|
1942
2160
|
}
|
|
1943
2161
|
if (i = this.tokenizer.def(t)) {
|
|
1944
2162
|
t = t.substring(i.raw.length);
|
|
1945
|
-
let
|
|
1946
|
-
(
|
|
2163
|
+
let l = r.at(-1);
|
|
2164
|
+
(l == null ? void 0 : l.type) === "paragraph" || (l == null ? void 0 : l.type) === "text" ? (l.raw += (l.raw.endsWith(`
|
|
1947
2165
|
`) ? "" : `
|
|
1948
|
-
`) + i.raw,
|
|
1949
|
-
` + i.raw, this.inlineQueue.at(-1).src =
|
|
2166
|
+
`) + i.raw, l.text += `
|
|
2167
|
+
` + i.raw, this.inlineQueue.at(-1).src = l.text) : this.tokens.links[i.tag] || (this.tokens.links[i.tag] = { href: i.href, title: i.title }, r.push(i));
|
|
1950
2168
|
continue;
|
|
1951
2169
|
}
|
|
1952
2170
|
if (i = this.tokenizer.table(t)) {
|
|
@@ -1959,34 +2177,34 @@ ${d}` : d;
|
|
|
1959
2177
|
}
|
|
1960
2178
|
let u = t;
|
|
1961
2179
|
if ((o = this.options.extensions) != null && o.startBlock) {
|
|
1962
|
-
let
|
|
2180
|
+
let l = 1 / 0, d = t.slice(1), p;
|
|
1963
2181
|
this.options.extensions.startBlock.forEach((w) => {
|
|
1964
|
-
p = w.call({ lexer: this }, d), typeof p == "number" && p >= 0 && (
|
|
1965
|
-
}),
|
|
2182
|
+
p = w.call({ lexer: this }, d), typeof p == "number" && p >= 0 && (l = Math.min(l, p));
|
|
2183
|
+
}), l < 1 / 0 && l >= 0 && (u = t.substring(0, l + 1));
|
|
1966
2184
|
}
|
|
1967
2185
|
if (this.state.top && (i = this.tokenizer.paragraph(u))) {
|
|
1968
|
-
let
|
|
1969
|
-
a && (
|
|
2186
|
+
let l = r.at(-1);
|
|
2187
|
+
a && (l == null ? void 0 : l.type) === "paragraph" ? (l.raw += (l.raw.endsWith(`
|
|
1970
2188
|
`) ? "" : `
|
|
1971
|
-
`) + i.raw,
|
|
1972
|
-
` + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src =
|
|
2189
|
+
`) + i.raw, l.text += `
|
|
2190
|
+
` + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : r.push(i), a = u.length !== t.length, t = t.substring(i.raw.length);
|
|
1973
2191
|
continue;
|
|
1974
2192
|
}
|
|
1975
2193
|
if (i = this.tokenizer.text(t)) {
|
|
1976
2194
|
t = t.substring(i.raw.length);
|
|
1977
|
-
let
|
|
1978
|
-
(
|
|
2195
|
+
let l = r.at(-1);
|
|
2196
|
+
(l == null ? void 0 : l.type) === "text" ? (l.raw += (l.raw.endsWith(`
|
|
1979
2197
|
`) ? "" : `
|
|
1980
|
-
`) + i.raw,
|
|
1981
|
-
` + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src =
|
|
2198
|
+
`) + i.raw, l.text += `
|
|
2199
|
+
` + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : r.push(i);
|
|
1982
2200
|
continue;
|
|
1983
2201
|
}
|
|
1984
2202
|
if (t) {
|
|
1985
|
-
let
|
|
2203
|
+
let l = "Infinite loop on byte: " + t.charCodeAt(0);
|
|
1986
2204
|
if (this.options.silent) {
|
|
1987
|
-
console.error(
|
|
2205
|
+
console.error(l);
|
|
1988
2206
|
break;
|
|
1989
|
-
} else throw new Error(
|
|
2207
|
+
} else throw new Error(l);
|
|
1990
2208
|
}
|
|
1991
2209
|
}
|
|
1992
2210
|
return this.state.top = !0, r;
|
|
@@ -1995,61 +2213,61 @@ ${d}` : d;
|
|
|
1995
2213
|
return this.inlineQueue.push({ src: t, tokens: r }), r;
|
|
1996
2214
|
}
|
|
1997
2215
|
inlineTokens(t, r = []) {
|
|
1998
|
-
var u,
|
|
2216
|
+
var u, l, d, p, w;
|
|
1999
2217
|
let a = t, s = null;
|
|
2000
2218
|
if (this.tokens.links) {
|
|
2001
|
-
let
|
|
2002
|
-
if (
|
|
2219
|
+
let c = Object.keys(this.tokens.links);
|
|
2220
|
+
if (c.length > 0) for (; (s = this.tokenizer.rules.inline.reflinkSearch.exec(a)) != null; ) c.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) && (a = a.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
2003
2221
|
}
|
|
2004
2222
|
for (; (s = this.tokenizer.rules.inline.anyPunctuation.exec(a)) != null; ) a = a.slice(0, s.index) + "++" + a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
2005
2223
|
let n;
|
|
2006
2224
|
for (; (s = this.tokenizer.rules.inline.blockSkip.exec(a)) != null; ) n = s[2] ? s[2].length : 0, a = a.slice(0, s.index + n) + "[" + "a".repeat(s[0].length - n - 2) + "]" + a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
2007
|
-
a = ((
|
|
2225
|
+
a = ((l = (u = this.options.hooks) == null ? void 0 : u.emStrongMask) == null ? void 0 : l.call({ lexer: this }, a)) ?? a;
|
|
2008
2226
|
let o = !1, i = "";
|
|
2009
2227
|
for (; t; ) {
|
|
2010
2228
|
o || (i = ""), o = !1;
|
|
2011
|
-
let
|
|
2012
|
-
if ((p = (d = this.options.extensions) == null ? void 0 : d.inline) != null && p.some((h) => (
|
|
2013
|
-
if (
|
|
2014
|
-
t = t.substring(
|
|
2229
|
+
let c;
|
|
2230
|
+
if ((p = (d = this.options.extensions) == null ? void 0 : d.inline) != null && p.some((h) => (c = h.call({ lexer: this }, t, r)) ? (t = t.substring(c.raw.length), r.push(c), !0) : !1)) continue;
|
|
2231
|
+
if (c = this.tokenizer.escape(t)) {
|
|
2232
|
+
t = t.substring(c.raw.length), r.push(c);
|
|
2015
2233
|
continue;
|
|
2016
2234
|
}
|
|
2017
|
-
if (
|
|
2018
|
-
t = t.substring(
|
|
2235
|
+
if (c = this.tokenizer.tag(t)) {
|
|
2236
|
+
t = t.substring(c.raw.length), r.push(c);
|
|
2019
2237
|
continue;
|
|
2020
2238
|
}
|
|
2021
|
-
if (
|
|
2022
|
-
t = t.substring(
|
|
2239
|
+
if (c = this.tokenizer.link(t)) {
|
|
2240
|
+
t = t.substring(c.raw.length), r.push(c);
|
|
2023
2241
|
continue;
|
|
2024
2242
|
}
|
|
2025
|
-
if (
|
|
2026
|
-
t = t.substring(
|
|
2243
|
+
if (c = this.tokenizer.reflink(t, this.tokens.links)) {
|
|
2244
|
+
t = t.substring(c.raw.length);
|
|
2027
2245
|
let h = r.at(-1);
|
|
2028
|
-
|
|
2246
|
+
c.type === "text" && (h == null ? void 0 : h.type) === "text" ? (h.raw += c.raw, h.text += c.text) : r.push(c);
|
|
2029
2247
|
continue;
|
|
2030
2248
|
}
|
|
2031
|
-
if (
|
|
2032
|
-
t = t.substring(
|
|
2249
|
+
if (c = this.tokenizer.emStrong(t, a, i)) {
|
|
2250
|
+
t = t.substring(c.raw.length), r.push(c);
|
|
2033
2251
|
continue;
|
|
2034
2252
|
}
|
|
2035
|
-
if (
|
|
2036
|
-
t = t.substring(
|
|
2253
|
+
if (c = this.tokenizer.codespan(t)) {
|
|
2254
|
+
t = t.substring(c.raw.length), r.push(c);
|
|
2037
2255
|
continue;
|
|
2038
2256
|
}
|
|
2039
|
-
if (
|
|
2040
|
-
t = t.substring(
|
|
2257
|
+
if (c = this.tokenizer.br(t)) {
|
|
2258
|
+
t = t.substring(c.raw.length), r.push(c);
|
|
2041
2259
|
continue;
|
|
2042
2260
|
}
|
|
2043
|
-
if (
|
|
2044
|
-
t = t.substring(
|
|
2261
|
+
if (c = this.tokenizer.del(t)) {
|
|
2262
|
+
t = t.substring(c.raw.length), r.push(c);
|
|
2045
2263
|
continue;
|
|
2046
2264
|
}
|
|
2047
|
-
if (
|
|
2048
|
-
t = t.substring(
|
|
2265
|
+
if (c = this.tokenizer.autolink(t)) {
|
|
2266
|
+
t = t.substring(c.raw.length), r.push(c);
|
|
2049
2267
|
continue;
|
|
2050
2268
|
}
|
|
2051
|
-
if (!this.state.inLink && (
|
|
2052
|
-
t = t.substring(
|
|
2269
|
+
if (!this.state.inLink && (c = this.tokenizer.url(t))) {
|
|
2270
|
+
t = t.substring(c.raw.length), r.push(c);
|
|
2053
2271
|
continue;
|
|
2054
2272
|
}
|
|
2055
2273
|
let m = t;
|
|
@@ -2059,10 +2277,10 @@ ${d}` : d;
|
|
|
2059
2277
|
f = b.call({ lexer: this }, g), typeof f == "number" && f >= 0 && (h = Math.min(h, f));
|
|
2060
2278
|
}), h < 1 / 0 && h >= 0 && (m = t.substring(0, h + 1));
|
|
2061
2279
|
}
|
|
2062
|
-
if (
|
|
2063
|
-
t = t.substring(
|
|
2280
|
+
if (c = this.tokenizer.inlineText(m)) {
|
|
2281
|
+
t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (i = c.raw.slice(-1)), o = !0;
|
|
2064
2282
|
let h = r.at(-1);
|
|
2065
|
-
(h == null ? void 0 : h.type) === "text" ? (h.raw +=
|
|
2283
|
+
(h == null ? void 0 : h.type) === "text" ? (h.raw += c.raw, h.text += c.text) : r.push(c);
|
|
2066
2284
|
continue;
|
|
2067
2285
|
}
|
|
2068
2286
|
if (t) {
|
|
@@ -2075,10 +2293,10 @@ ${d}` : d;
|
|
|
2075
2293
|
}
|
|
2076
2294
|
return r;
|
|
2077
2295
|
}
|
|
2078
|
-
},
|
|
2296
|
+
}, Ae = class {
|
|
2079
2297
|
constructor(e) {
|
|
2080
|
-
|
|
2081
|
-
|
|
2298
|
+
V(this, "options");
|
|
2299
|
+
V(this, "parser");
|
|
2082
2300
|
this.options = e || ee;
|
|
2083
2301
|
}
|
|
2084
2302
|
space(e) {
|
|
@@ -2088,8 +2306,8 @@ ${d}` : d;
|
|
|
2088
2306
|
var n;
|
|
2089
2307
|
let a = (n = (t || "").match(q.notSpaceStart)) == null ? void 0 : n[0], s = e.replace(q.endingNewline, "") + `
|
|
2090
2308
|
`;
|
|
2091
|
-
return a ? '<pre><code class="language-' +
|
|
2092
|
-
` : "<pre><code>" + (r ? s :
|
|
2309
|
+
return a ? '<pre><code class="language-' + W(a) + '">' + (r ? s : W(s, !0)) + `</code></pre>
|
|
2310
|
+
` : "<pre><code>" + (r ? s : W(s, !0)) + `</code></pre>
|
|
2093
2311
|
`;
|
|
2094
2312
|
}
|
|
2095
2313
|
blockquote({ tokens: e }) {
|
|
@@ -2167,7 +2385,7 @@ ${e}</tr>
|
|
|
2167
2385
|
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
2168
2386
|
}
|
|
2169
2387
|
codespan({ text: e }) {
|
|
2170
|
-
return `<code>${
|
|
2388
|
+
return `<code>${W(e, !0)}</code>`;
|
|
2171
2389
|
}
|
|
2172
2390
|
br(e) {
|
|
2173
2391
|
return "<br>";
|
|
@@ -2180,18 +2398,18 @@ ${e}</tr>
|
|
|
2180
2398
|
if (s === null) return a;
|
|
2181
2399
|
e = s;
|
|
2182
2400
|
let n = '<a href="' + e + '"';
|
|
2183
|
-
return t && (n += ' title="' +
|
|
2401
|
+
return t && (n += ' title="' + W(t) + '"'), n += ">" + a + "</a>", n;
|
|
2184
2402
|
}
|
|
2185
2403
|
image({ href: e, title: t, text: r, tokens: a }) {
|
|
2186
2404
|
a && (r = this.parser.parseInline(a, this.parser.textRenderer));
|
|
2187
2405
|
let s = gt(e);
|
|
2188
|
-
if (s === null) return
|
|
2406
|
+
if (s === null) return W(r);
|
|
2189
2407
|
e = s;
|
|
2190
2408
|
let n = `<img src="${e}" alt="${r}"`;
|
|
2191
|
-
return t && (n += ` title="${
|
|
2409
|
+
return t && (n += ` title="${W(t)}"`), n += ">", n;
|
|
2192
2410
|
}
|
|
2193
2411
|
text(e) {
|
|
2194
|
-
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text :
|
|
2412
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : W(e.text);
|
|
2195
2413
|
}
|
|
2196
2414
|
}, st = class {
|
|
2197
2415
|
strong({ text: e }) {
|
|
@@ -2224,18 +2442,18 @@ ${e}</tr>
|
|
|
2224
2442
|
checkbox({ raw: e }) {
|
|
2225
2443
|
return e;
|
|
2226
2444
|
}
|
|
2227
|
-
}, N = class
|
|
2445
|
+
}, N = class De {
|
|
2228
2446
|
constructor(t) {
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
this.options = t || ee, this.options.renderer = this.options.renderer || new
|
|
2447
|
+
V(this, "options");
|
|
2448
|
+
V(this, "renderer");
|
|
2449
|
+
V(this, "textRenderer");
|
|
2450
|
+
this.options = t || ee, this.options.renderer = this.options.renderer || new Ae(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new st();
|
|
2233
2451
|
}
|
|
2234
2452
|
static parse(t, r) {
|
|
2235
|
-
return new
|
|
2453
|
+
return new De(r).parse(t);
|
|
2236
2454
|
}
|
|
2237
2455
|
static parseInline(t, r) {
|
|
2238
|
-
return new
|
|
2456
|
+
return new De(r).parseInline(t);
|
|
2239
2457
|
}
|
|
2240
2458
|
parse(t) {
|
|
2241
2459
|
var a, s;
|
|
@@ -2243,9 +2461,9 @@ ${e}</tr>
|
|
|
2243
2461
|
for (let n = 0; n < t.length; n++) {
|
|
2244
2462
|
let o = t[n];
|
|
2245
2463
|
if ((s = (a = this.options.extensions) == null ? void 0 : a.renderers) != null && s[o.type]) {
|
|
2246
|
-
let u = o,
|
|
2247
|
-
if (
|
|
2248
|
-
r +=
|
|
2464
|
+
let u = o, l = this.options.extensions.renderers[u.type].call({ parser: this }, u);
|
|
2465
|
+
if (l !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(u.type)) {
|
|
2466
|
+
r += l || "";
|
|
2249
2467
|
continue;
|
|
2250
2468
|
}
|
|
2251
2469
|
}
|
|
@@ -2314,9 +2532,9 @@ ${e}</tr>
|
|
|
2314
2532
|
for (let o = 0; o < t.length; o++) {
|
|
2315
2533
|
let i = t[o];
|
|
2316
2534
|
if ((n = (s = this.options.extensions) == null ? void 0 : s.renderers) != null && n[i.type]) {
|
|
2317
|
-
let
|
|
2318
|
-
if (
|
|
2319
|
-
a +=
|
|
2535
|
+
let l = this.options.extensions.renderers[i.type].call({ parser: this }, i);
|
|
2536
|
+
if (l !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
|
|
2537
|
+
a += l || "";
|
|
2320
2538
|
continue;
|
|
2321
2539
|
}
|
|
2322
2540
|
}
|
|
@@ -2367,9 +2585,9 @@ ${e}</tr>
|
|
|
2367
2585
|
break;
|
|
2368
2586
|
}
|
|
2369
2587
|
default: {
|
|
2370
|
-
let
|
|
2371
|
-
if (this.options.silent) return console.error(
|
|
2372
|
-
throw new Error(
|
|
2588
|
+
let l = 'Token with "' + u.type + '" type was not found.';
|
|
2589
|
+
if (this.options.silent) return console.error(l), "";
|
|
2590
|
+
throw new Error(l);
|
|
2373
2591
|
}
|
|
2374
2592
|
}
|
|
2375
2593
|
}
|
|
@@ -2377,8 +2595,8 @@ ${e}</tr>
|
|
|
2377
2595
|
}
|
|
2378
2596
|
}, xe, pe = (xe = class {
|
|
2379
2597
|
constructor(e) {
|
|
2380
|
-
|
|
2381
|
-
|
|
2598
|
+
V(this, "options");
|
|
2599
|
+
V(this, "block");
|
|
2382
2600
|
this.options = e || ee;
|
|
2383
2601
|
}
|
|
2384
2602
|
preprocess(e) {
|
|
@@ -2399,18 +2617,18 @@ ${e}</tr>
|
|
|
2399
2617
|
provideParser() {
|
|
2400
2618
|
return this.block ? N.parse : N.parseInline;
|
|
2401
2619
|
}
|
|
2402
|
-
},
|
|
2620
|
+
}, V(xe, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), V(xe, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), xe), Ka = class {
|
|
2403
2621
|
constructor(...e) {
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2622
|
+
V(this, "defaults", Ke());
|
|
2623
|
+
V(this, "options", this.setOptions);
|
|
2624
|
+
V(this, "parse", this.parseMarkdown(!0));
|
|
2625
|
+
V(this, "parseInline", this.parseMarkdown(!1));
|
|
2626
|
+
V(this, "Parser", N);
|
|
2627
|
+
V(this, "Renderer", Ae);
|
|
2628
|
+
V(this, "TextRenderer", st);
|
|
2629
|
+
V(this, "Lexer", F);
|
|
2630
|
+
V(this, "Tokenizer", ze);
|
|
2631
|
+
V(this, "Hooks", pe);
|
|
2414
2632
|
this.use(...e);
|
|
2415
2633
|
}
|
|
2416
2634
|
walkTokens(e, t) {
|
|
@@ -2458,27 +2676,27 @@ ${e}</tr>
|
|
|
2458
2676
|
}
|
|
2459
2677
|
"childTokens" in s && s.childTokens && (t.childTokens[s.name] = s.childTokens);
|
|
2460
2678
|
}), a.extensions = t), r.renderer) {
|
|
2461
|
-
let s = this.defaults.renderer || new
|
|
2679
|
+
let s = this.defaults.renderer || new Ae(this.defaults);
|
|
2462
2680
|
for (let n in r.renderer) {
|
|
2463
2681
|
if (!(n in s)) throw new Error(`renderer '${n}' does not exist`);
|
|
2464
2682
|
if (["options", "parser"].includes(n)) continue;
|
|
2465
2683
|
let o = n, i = r.renderer[o], u = s[o];
|
|
2466
|
-
s[o] = (...
|
|
2467
|
-
let d = i.apply(s,
|
|
2468
|
-
return d === !1 && (d = u.apply(s,
|
|
2684
|
+
s[o] = (...l) => {
|
|
2685
|
+
let d = i.apply(s, l);
|
|
2686
|
+
return d === !1 && (d = u.apply(s, l)), d || "";
|
|
2469
2687
|
};
|
|
2470
2688
|
}
|
|
2471
2689
|
a.renderer = s;
|
|
2472
2690
|
}
|
|
2473
2691
|
if (r.tokenizer) {
|
|
2474
|
-
let s = this.defaults.tokenizer || new
|
|
2692
|
+
let s = this.defaults.tokenizer || new ze(this.defaults);
|
|
2475
2693
|
for (let n in r.tokenizer) {
|
|
2476
2694
|
if (!(n in s)) throw new Error(`tokenizer '${n}' does not exist`);
|
|
2477
2695
|
if (["options", "rules", "lexer"].includes(n)) continue;
|
|
2478
2696
|
let o = n, i = r.tokenizer[o], u = s[o];
|
|
2479
|
-
s[o] = (...
|
|
2480
|
-
let d = i.apply(s,
|
|
2481
|
-
return d === !1 && (d = u.apply(s,
|
|
2697
|
+
s[o] = (...l) => {
|
|
2698
|
+
let d = i.apply(s, l);
|
|
2699
|
+
return d === !1 && (d = u.apply(s, l)), d;
|
|
2482
2700
|
};
|
|
2483
2701
|
}
|
|
2484
2702
|
a.tokenizer = s;
|
|
@@ -2489,20 +2707,20 @@ ${e}</tr>
|
|
|
2489
2707
|
if (!(n in s)) throw new Error(`hook '${n}' does not exist`);
|
|
2490
2708
|
if (["options", "block"].includes(n)) continue;
|
|
2491
2709
|
let o = n, i = r.hooks[o], u = s[o];
|
|
2492
|
-
pe.passThroughHooks.has(n) ? s[o] = (
|
|
2710
|
+
pe.passThroughHooks.has(n) ? s[o] = (l) => {
|
|
2493
2711
|
if (this.defaults.async && pe.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
2494
|
-
let p = await i.call(s,
|
|
2712
|
+
let p = await i.call(s, l);
|
|
2495
2713
|
return u.call(s, p);
|
|
2496
2714
|
})();
|
|
2497
|
-
let d = i.call(s,
|
|
2715
|
+
let d = i.call(s, l);
|
|
2498
2716
|
return u.call(s, d);
|
|
2499
|
-
} : s[o] = (...
|
|
2717
|
+
} : s[o] = (...l) => {
|
|
2500
2718
|
if (this.defaults.async) return (async () => {
|
|
2501
|
-
let p = await i.apply(s,
|
|
2502
|
-
return p === !1 && (p = await u.apply(s,
|
|
2719
|
+
let p = await i.apply(s, l);
|
|
2720
|
+
return p === !1 && (p = await u.apply(s, l)), p;
|
|
2503
2721
|
})();
|
|
2504
|
-
let d = i.apply(s,
|
|
2505
|
-
return d === !1 && (d = u.apply(s,
|
|
2722
|
+
let d = i.apply(s, l);
|
|
2723
|
+
return d === !1 && (d = u.apply(s, l)), d;
|
|
2506
2724
|
};
|
|
2507
2725
|
}
|
|
2508
2726
|
a.hooks = s;
|
|
@@ -2535,8 +2753,8 @@ ${e}</tr>
|
|
|
2535
2753
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
|
|
2536
2754
|
let o = s.hooks ? await s.hooks.preprocess(t) : t, i = await (s.hooks ? await s.hooks.provideLexer() : e ? F.lex : F.lexInline)(o, s), u = s.hooks ? await s.hooks.processAllTokens(i) : i;
|
|
2537
2755
|
s.walkTokens && await Promise.all(this.walkTokens(u, s.walkTokens));
|
|
2538
|
-
let
|
|
2539
|
-
return s.hooks ? await s.hooks.postprocess(
|
|
2756
|
+
let l = await (s.hooks ? await s.hooks.provideParser() : e ? N.parse : N.parseInline)(u, s);
|
|
2757
|
+
return s.hooks ? await s.hooks.postprocess(l) : l;
|
|
2540
2758
|
})().catch(n);
|
|
2541
2759
|
try {
|
|
2542
2760
|
s.hooks && (t = s.hooks.preprocess(t));
|
|
@@ -2553,7 +2771,7 @@ ${e}</tr>
|
|
|
2553
2771
|
return (r) => {
|
|
2554
2772
|
if (r.message += `
|
|
2555
2773
|
Please report this to https://github.com/markedjs/marked.`, e) {
|
|
2556
|
-
let a = "<p>An error occurred:</p><pre>" +
|
|
2774
|
+
let a = "<p>An error occurred:</p><pre>" + W(r.message + "", !0) + "</pre>";
|
|
2557
2775
|
return t ? Promise.resolve(a) : a;
|
|
2558
2776
|
}
|
|
2559
2777
|
if (t) return Promise.reject(r);
|
|
@@ -2561,35 +2779,35 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
2561
2779
|
};
|
|
2562
2780
|
}
|
|
2563
2781
|
}, Q = new Ka();
|
|
2564
|
-
function
|
|
2782
|
+
function H(e, t) {
|
|
2565
2783
|
return Q.parse(e, t);
|
|
2566
2784
|
}
|
|
2567
|
-
|
|
2568
|
-
return Q.setOptions(e),
|
|
2785
|
+
H.options = H.setOptions = function(e) {
|
|
2786
|
+
return Q.setOptions(e), H.defaults = Q.defaults, mr(H.defaults), H;
|
|
2569
2787
|
};
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
return Q.use(...e),
|
|
2788
|
+
H.getDefaults = Ke;
|
|
2789
|
+
H.defaults = ee;
|
|
2790
|
+
H.use = function(...e) {
|
|
2791
|
+
return Q.use(...e), H.defaults = Q.defaults, mr(H.defaults), H;
|
|
2574
2792
|
};
|
|
2575
|
-
|
|
2793
|
+
H.walkTokens = function(e, t) {
|
|
2576
2794
|
return Q.walkTokens(e, t);
|
|
2577
2795
|
};
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2796
|
+
H.parseInline = Q.parseInline;
|
|
2797
|
+
H.Parser = N;
|
|
2798
|
+
H.parser = N.parse;
|
|
2799
|
+
H.Renderer = Ae;
|
|
2800
|
+
H.TextRenderer = st;
|
|
2801
|
+
H.Lexer = F;
|
|
2802
|
+
H.lexer = F.lex;
|
|
2803
|
+
H.Tokenizer = ze;
|
|
2804
|
+
H.Hooks = pe;
|
|
2805
|
+
H.parse = H;
|
|
2806
|
+
H.options;
|
|
2807
|
+
H.setOptions;
|
|
2808
|
+
H.use;
|
|
2809
|
+
H.walkTokens;
|
|
2810
|
+
H.parseInline;
|
|
2593
2811
|
N.parse;
|
|
2594
2812
|
F.lex;
|
|
2595
2813
|
const Ja = ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp", "ico", "avif"];
|
|
@@ -2614,18 +2832,18 @@ function Qa(e) {
|
|
|
2614
2832
|
);
|
|
2615
2833
|
e = e.replace(a, (n, o, i) => {
|
|
2616
2834
|
const u = i && !i.match(/^(view|see|open|click|image|photo|picture)$/i) ? i : "";
|
|
2617
|
-
return
|
|
2835
|
+
return qe(o, u, u);
|
|
2618
2836
|
});
|
|
2619
2837
|
const s = new RegExp(
|
|
2620
2838
|
`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(?:${r})(\\?[^\\s<>"]*)?)(?!["'])`,
|
|
2621
2839
|
"gi"
|
|
2622
2840
|
);
|
|
2623
|
-
e = e.replace(s, (n, o) =>
|
|
2841
|
+
e = e.replace(s, (n, o) => qe(o, "", ""));
|
|
2624
2842
|
for (let n = t.length - 1; n >= 0; n--)
|
|
2625
2843
|
e = e.replace(`__IMG_PROTECTED_${n}__`, t[n]);
|
|
2626
2844
|
return e;
|
|
2627
2845
|
}
|
|
2628
|
-
function
|
|
2846
|
+
function qe(e, t, r) {
|
|
2629
2847
|
const a = t || r || "";
|
|
2630
2848
|
let s = "artifactuse-image";
|
|
2631
2849
|
e.includes("large2x") || e.includes("large") || r != null && r.toLowerCase().includes("hero") ? s = "artifactuse-hero-image" : e.includes("small") || e.includes("tiny") ? s = "artifactuse-inline-image" : (r != null && r.toLowerCase().includes("aerial") || r != null && r.toLowerCase().includes("view")) && (s = "artifactuse-hero-image");
|
|
@@ -2640,11 +2858,11 @@ function Ya(e) {
|
|
|
2640
2858
|
const o = t[n].trim();
|
|
2641
2859
|
if (o.includes('<div class="artifactuse-image-container">')) {
|
|
2642
2860
|
s || (s = !0, a = []);
|
|
2643
|
-
let i = "", u = n,
|
|
2861
|
+
let i = "", u = n, l = 0;
|
|
2644
2862
|
for (; u < t.length; ) {
|
|
2645
2863
|
const d = t[u];
|
|
2646
2864
|
if (i += d + `
|
|
2647
|
-
`,
|
|
2865
|
+
`, l += (d.match(/<div/g) || []).length, l -= (d.match(/<\/div>/g) || []).length, l === 0) break;
|
|
2648
2866
|
u++;
|
|
2649
2867
|
}
|
|
2650
2868
|
a.push(i.trim()), n = u;
|
|
@@ -2672,10 +2890,10 @@ ${e.map((r) => r.replace("artifactuse-image-container", "artifactuse-gallery-ite
|
|
|
2672
2890
|
`)}
|
|
2673
2891
|
</div>`;
|
|
2674
2892
|
}
|
|
2675
|
-
const
|
|
2893
|
+
const Sr = ["mp4", "webm", "mov", "avi", "mkv", "flv", "wmv", "m4v"];
|
|
2676
2894
|
function es(e) {
|
|
2677
2895
|
if (!e) return !1;
|
|
2678
|
-
const t =
|
|
2896
|
+
const t = Sr.join("|");
|
|
2679
2897
|
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));
|
|
2680
2898
|
}
|
|
2681
2899
|
function ts(e) {
|
|
@@ -2685,7 +2903,7 @@ function ts(e) {
|
|
|
2685
2903
|
if (t = e.match(/vimeo\.com\/(\d+)/), t) return { type: "vimeo", id: t[1] };
|
|
2686
2904
|
if (t = e.match(/loom\.com\/share\/([a-zA-Z0-9]+)/), t) return { type: "loom", id: t[1] };
|
|
2687
2905
|
if (t = e.match(/dailymotion\.com\/video\/([a-zA-Z0-9]+)/), t) return { type: "dailymotion", id: t[1] };
|
|
2688
|
-
const r =
|
|
2906
|
+
const r = Sr.join("|");
|
|
2689
2907
|
return new RegExp(`\\.(${r})(\\?.*)?$`, "i").test(e) ? { type: "direct", id: e } : null;
|
|
2690
2908
|
}
|
|
2691
2909
|
function rs(e) {
|
|
@@ -2695,53 +2913,53 @@ function rs(e) {
|
|
|
2695
2913
|
case "youtube":
|
|
2696
2914
|
return Oe(t.id);
|
|
2697
2915
|
case "vimeo":
|
|
2698
|
-
return
|
|
2916
|
+
return Be(t.id);
|
|
2699
2917
|
case "loom":
|
|
2700
2918
|
return Fe(t.id);
|
|
2701
2919
|
case "dailymotion":
|
|
2702
2920
|
return Ne(t.id);
|
|
2703
2921
|
case "direct":
|
|
2704
|
-
return
|
|
2922
|
+
return Ze(t.id);
|
|
2705
2923
|
default:
|
|
2706
2924
|
return `<a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a>`;
|
|
2707
2925
|
}
|
|
2708
2926
|
}
|
|
2709
2927
|
function as(e) {
|
|
2710
2928
|
const t = [];
|
|
2711
|
-
e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (
|
|
2929
|
+
e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (c) => {
|
|
2712
2930
|
const m = `__PROTECTED_${t.length}__`;
|
|
2713
|
-
return t.push(
|
|
2714
|
-
}), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (
|
|
2931
|
+
return t.push(c), m;
|
|
2932
|
+
}), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (c) => {
|
|
2715
2933
|
const m = `__PROTECTED_${t.length}__`;
|
|
2716
|
-
return t.push(
|
|
2717
|
-
}), e = e.replace(/<(video|audio|iframe)[^>]*>[\s\S]*?<\/\1>/gi, (
|
|
2934
|
+
return t.push(c), m;
|
|
2935
|
+
}), e = e.replace(/<(video|audio|iframe)[^>]*>[\s\S]*?<\/\1>/gi, (c) => {
|
|
2718
2936
|
const m = `__PROTECTED_${t.length}__`;
|
|
2719
|
-
return t.push(
|
|
2937
|
+
return t.push(c), m;
|
|
2720
2938
|
});
|
|
2721
2939
|
const r = /\[([^\]]+)\]\((https:\/\/www\.pexels\.com\/video\/[^)]+)\)\s*(?:<\/p>)?\s*(?:<p>)?\s*(?:Preview image:\s*)?!\[([^\]]*)\]\((https:\/\/images\.pexels\.com\/videos\/[^)]+)\)/gi;
|
|
2722
|
-
e = e.replace(r, (
|
|
2940
|
+
e = e.replace(r, (c, m, h, g, f) => ns(m, h, f, g));
|
|
2723
2941
|
const a = /<a[^>]*href="(https?:\/\/[^"]+\.(mp4|webm|mov|avi|mkv|flv|wmv|m4v)(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
|
|
2724
|
-
e = e.replace(a, (
|
|
2942
|
+
e = e.replace(a, (c, m) => Ze(m));
|
|
2725
2943
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(mp4|webm|mov|avi|mkv|flv|wmv|m4v)(\\?[^\\s<>"]*)?)(?!["'])`, "gi");
|
|
2726
|
-
e = e.replace(s, (
|
|
2944
|
+
e = e.replace(s, (c, m) => Ze(m));
|
|
2727
2945
|
const n = /<a[^>]*href="(https?:\/\/(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
2728
|
-
e = e.replace(n, (
|
|
2946
|
+
e = e.replace(n, (c, m, h) => Oe(h));
|
|
2729
2947
|
const o = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/)([a-zA-Z0-9_-]+))(?!["'])`, "gi");
|
|
2730
|
-
e = e.replace(o, (
|
|
2948
|
+
e = e.replace(o, (c, m, h) => Oe(h));
|
|
2731
2949
|
const i = /<a[^>]*href="(https?:\/\/(?:www\.)?vimeo\.com\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
2732
|
-
e = e.replace(i, (
|
|
2950
|
+
e = e.replace(i, (c, m, h) => Be(h));
|
|
2733
2951
|
const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?vimeo\\.com\\/(\\d+))(?!["'])`, "gi");
|
|
2734
|
-
e = e.replace(u, (
|
|
2735
|
-
const
|
|
2736
|
-
e = e.replace(
|
|
2952
|
+
e = e.replace(u, (c, m, h) => Be(h));
|
|
2953
|
+
const l = /<a[^>]*href="(https?:\/\/(?:www\.)?loom\.com\/share\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
2954
|
+
e = e.replace(l, (c, m, h) => Fe(h));
|
|
2737
2955
|
const d = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?loom\\.com\\/share\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
2738
|
-
e = e.replace(d, (
|
|
2956
|
+
e = e.replace(d, (c, m, h) => Fe(h));
|
|
2739
2957
|
const p = /<a[^>]*href="(https?:\/\/(?:www\.)?dailymotion\.com\/video\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
2740
|
-
e = e.replace(p, (
|
|
2958
|
+
e = e.replace(p, (c, m, h) => Ne(h));
|
|
2741
2959
|
const w = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?dailymotion\\.com\\/video\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
2742
|
-
e = e.replace(w, (
|
|
2743
|
-
for (let
|
|
2744
|
-
e = e.replace(`__PROTECTED_${
|
|
2960
|
+
e = e.replace(w, (c, m, h) => Ne(h));
|
|
2961
|
+
for (let c = t.length - 1; c >= 0; c--)
|
|
2962
|
+
e = e.replace(`__PROTECTED_${c}__`, t[c]);
|
|
2745
2963
|
return e;
|
|
2746
2964
|
}
|
|
2747
2965
|
function ss(e) {
|
|
@@ -2757,7 +2975,7 @@ function ss(e) {
|
|
|
2757
2975
|
wmv: "video/x-ms-wmv"
|
|
2758
2976
|
}[t] || "video/mp4";
|
|
2759
2977
|
}
|
|
2760
|
-
function
|
|
2978
|
+
function Ze(e) {
|
|
2761
2979
|
const t = ss(e);
|
|
2762
2980
|
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>`;
|
|
2763
2981
|
}
|
|
@@ -2768,7 +2986,7 @@ function Oe(e) {
|
|
|
2768
2986
|
const t = `https://i.ytimg.com/vi/${e}/hqdefault.jpg`, a = `this.parentElement.innerHTML='<iframe src=\\'${`https://www.youtube.com/embed/${e}?autoplay=1`}\\' frameborder=\\'0\\' allow=\\'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\\' allowfullscreen class=\\'artifactuse-video-iframe\\'></iframe>'`;
|
|
2769
2987
|
return `<div class="artifactuse-video-wrapper artifactuse-video-lazy" data-video-type="youtube" data-video-id="${e}"><button type="button" class="artifactuse-video-facade" aria-label="Play YouTube video" onclick="${a}"><img src="${t}" alt="YouTube video thumbnail" class="artifactuse-video-thumbnail" loading="lazy" /><div class="artifactuse-video-play-button artifactuse-youtube-play"><svg viewBox="0 0 68 48" width="68" height="48"><path class="artifactuse-youtube-play-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"/><path d="M 45,24 27,14 27,34" fill="#fff"/></svg></div></button></div>`;
|
|
2770
2988
|
}
|
|
2771
|
-
function
|
|
2989
|
+
function Be(e) {
|
|
2772
2990
|
const t = `https://player.vimeo.com/video/${e}?autoplay=1`, r = `https://vumbnail.com/${e}.jpg`, a = `this.parentElement.innerHTML='<iframe src=\\'${t}\\' frameborder=\\'0\\' allow=\\'autoplay; fullscreen; picture-in-picture\\' allowfullscreen class=\\'artifactuse-video-iframe\\'></iframe>'`;
|
|
2773
2991
|
return `<div class="artifactuse-video-wrapper artifactuse-video-lazy" data-video-type="vimeo" data-video-id="${e}"><button type="button" class="artifactuse-video-facade" aria-label="Play Vimeo video" onclick="${a}"><img src="${r}" alt="Vimeo video thumbnail" class="artifactuse-video-thumbnail" loading="lazy" onerror="this.style.display='none'" /><div class="artifactuse-video-play-button artifactuse-vimeo-play"><svg viewBox="0 0 64 64" width="64" height="64"><circle cx="32" cy="32" r="31" fill="#1ab7ea"/><path d="M26 20 L26 44 L46 32 Z" fill="#fff"/></svg></div></button></div>`;
|
|
2774
2992
|
}
|
|
@@ -2803,11 +3021,11 @@ function os(e) {
|
|
|
2803
3021
|
let a;
|
|
2804
3022
|
for (; (a = t.exec(e)) !== null; ) {
|
|
2805
3023
|
const u = a.index;
|
|
2806
|
-
let
|
|
3024
|
+
let l = 0, d = u;
|
|
2807
3025
|
for (let p = u; p < e.length; p++)
|
|
2808
3026
|
if (e.substring(p, p + 4) === "<div")
|
|
2809
|
-
|
|
2810
|
-
else if (e.substring(p, p + 6) === "</div>" && (
|
|
3027
|
+
l++;
|
|
3028
|
+
else if (e.substring(p, p + 6) === "</div>" && (l--, l === 0)) {
|
|
2811
3029
|
d = p + 6;
|
|
2812
3030
|
break;
|
|
2813
3031
|
}
|
|
@@ -2825,33 +3043,33 @@ function os(e) {
|
|
|
2825
3043
|
caption: Pe(e.substring(0, r[0].start))
|
|
2826
3044
|
}];
|
|
2827
3045
|
for (let u = 1; u < r.length; u++) {
|
|
2828
|
-
const
|
|
3046
|
+
const l = r[u - 1], d = r[u], p = e.substring(l.end, d.start);
|
|
2829
3047
|
is(p) ? n.push({
|
|
2830
3048
|
...d,
|
|
2831
3049
|
caption: Pe(p)
|
|
2832
3050
|
}) : (s.push([...n]), n = [{
|
|
2833
3051
|
...d,
|
|
2834
|
-
caption: Pe(e.substring(
|
|
3052
|
+
caption: Pe(e.substring(l.end, d.start))
|
|
2835
3053
|
}]);
|
|
2836
3054
|
}
|
|
2837
3055
|
s.push(n);
|
|
2838
3056
|
let o = "", i = 0;
|
|
2839
3057
|
for (const u of s) {
|
|
2840
3058
|
if (u.length === 0) continue;
|
|
2841
|
-
const
|
|
2842
|
-
let d =
|
|
2843
|
-
const w = e.substring(i,
|
|
2844
|
-
if (w && (d =
|
|
2845
|
-
o +=
|
|
3059
|
+
const l = u[0];
|
|
3060
|
+
let d = l.start;
|
|
3061
|
+
const w = e.substring(i, l.start).match(/<p>((?:[^<]|<(?!\/p>))*?)(?:<br\s*\/?>)?\s*<\/p>\s*$/);
|
|
3062
|
+
if (w && (d = l.start - w[0].length, u[0].caption = w[1].trim()), o += e.substring(i, d), u.length >= 2)
|
|
3063
|
+
o += ls(u);
|
|
2846
3064
|
else {
|
|
2847
|
-
const
|
|
2848
|
-
|
|
3065
|
+
const c = u[0];
|
|
3066
|
+
c.caption ? o += `<div class="artifactuse-video-container">${c.html}<div class="artifactuse-video-caption">${c.caption}</div></div>` : o += c.html;
|
|
2849
3067
|
}
|
|
2850
3068
|
i = u[u.length - 1].end;
|
|
2851
3069
|
}
|
|
2852
3070
|
return o += e.substring(i), o = o.replace(/<p>\s*<\/p>/g, ""), o;
|
|
2853
3071
|
}
|
|
2854
|
-
function
|
|
3072
|
+
function ls(e) {
|
|
2855
3073
|
return `<div class="artifactuse-video-gallery">
|
|
2856
3074
|
${e.map(({ html: r, caption: a }) => {
|
|
2857
3075
|
let s = r.replace(
|
|
@@ -2866,59 +3084,59 @@ ${e.map(({ html: r, caption: a }) => {
|
|
|
2866
3084
|
`)}
|
|
2867
3085
|
</div>`;
|
|
2868
3086
|
}
|
|
2869
|
-
function
|
|
3087
|
+
function cs() {
|
|
2870
3088
|
return `audio-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2871
3089
|
}
|
|
2872
3090
|
function us(e, t = {}) {
|
|
2873
3091
|
const r = t.theme || "dark", a = [];
|
|
2874
|
-
e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (
|
|
2875
|
-
const
|
|
2876
|
-
return a.push(
|
|
2877
|
-
}), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (
|
|
2878
|
-
const
|
|
2879
|
-
return a.push(
|
|
2880
|
-
}), e = e.replace(/<(video|audio|iframe)[^>]*>[\s\S]*?<\/\1>/gi, (
|
|
2881
|
-
const
|
|
2882
|
-
return a.push(
|
|
3092
|
+
e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (z) => {
|
|
3093
|
+
const S = `__PROTECTED_${a.length}__`;
|
|
3094
|
+
return a.push(z), S;
|
|
3095
|
+
}), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (z) => {
|
|
3096
|
+
const S = `__PROTECTED_${a.length}__`;
|
|
3097
|
+
return a.push(z), S;
|
|
3098
|
+
}), e = e.replace(/<(video|audio|iframe)[^>]*>[\s\S]*?<\/\1>/gi, (z) => {
|
|
3099
|
+
const S = `__PROTECTED_${a.length}__`;
|
|
3100
|
+
return a.push(z), S;
|
|
2883
3101
|
});
|
|
2884
3102
|
const s = /<a[^>]*href="(https?:\/\/[^"]+\.(mp3|wav|flac|aac|ogg|m4a|wma)(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
|
|
2885
|
-
e = e.replace(s, (
|
|
3103
|
+
e = e.replace(s, (z, S) => vt(S));
|
|
2886
3104
|
const n = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(mp3|wav|flac|aac|ogg|m4a|wma)(\\?[^\\s<>"]*)?)(?!["'])`, "gi");
|
|
2887
|
-
e = e.replace(n, (
|
|
3105
|
+
e = e.replace(n, (z, S) => vt(S));
|
|
2888
3106
|
const o = /<a[^>]*href="(https?:\/\/(?:www\.)?soundcloud\.com\/[^"]+)"[^>]*>[^<]*<\/a>/gi;
|
|
2889
|
-
e = e.replace(o, (
|
|
3107
|
+
e = e.replace(o, (z, S) => yt(S));
|
|
2890
3108
|
const i = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?soundcloud\\.com\\/[^\\s<>"]+)(?!["'])`, "gi");
|
|
2891
|
-
e = e.replace(i, (
|
|
3109
|
+
e = e.replace(i, (z, S) => yt(S));
|
|
2892
3110
|
const u = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/track\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
2893
|
-
e = e.replace(u, (
|
|
2894
|
-
const
|
|
2895
|
-
e = e.replace(
|
|
3111
|
+
e = e.replace(u, (z, S, y) => B("track", y, r));
|
|
3112
|
+
const l = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/track\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
3113
|
+
e = e.replace(l, (z, S, y) => B("track", y, r));
|
|
2896
3114
|
const d = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/album\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
2897
|
-
e = e.replace(d, (
|
|
3115
|
+
e = e.replace(d, (z, S, y) => B("album", y, r));
|
|
2898
3116
|
const p = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/album\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
2899
|
-
e = e.replace(p, (
|
|
3117
|
+
e = e.replace(p, (z, S, y) => B("album", y, r));
|
|
2900
3118
|
const w = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/playlist\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
2901
|
-
e = e.replace(w, (
|
|
2902
|
-
const
|
|
2903
|
-
e = e.replace(
|
|
3119
|
+
e = e.replace(w, (z, S, y) => B("playlist", y, r));
|
|
3120
|
+
const c = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/playlist\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
3121
|
+
e = e.replace(c, (z, S, y) => B("playlist", y, r));
|
|
2904
3122
|
const m = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/artist\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
2905
|
-
e = e.replace(m, (
|
|
3123
|
+
e = e.replace(m, (z, S, y) => B("artist", y, r));
|
|
2906
3124
|
const h = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/artist\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
2907
|
-
e = e.replace(h, (
|
|
3125
|
+
e = e.replace(h, (z, S, y) => B("artist", y, r));
|
|
2908
3126
|
const g = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/episode\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
2909
|
-
e = e.replace(g, (
|
|
3127
|
+
e = e.replace(g, (z, S, y) => B("episode", y, r));
|
|
2910
3128
|
const f = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/episode\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
2911
|
-
e = e.replace(f, (
|
|
3129
|
+
e = e.replace(f, (z, S, y) => B("episode", y, r));
|
|
2912
3130
|
const b = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/show\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
2913
|
-
e = e.replace(b, (
|
|
2914
|
-
const
|
|
2915
|
-
e = e.replace(
|
|
2916
|
-
const
|
|
2917
|
-
e = e.replace(
|
|
2918
|
-
const
|
|
2919
|
-
e = e.replace(
|
|
2920
|
-
for (let
|
|
2921
|
-
e = e.replace(`__PROTECTED_${
|
|
3131
|
+
e = e.replace(b, (z, S, y) => B("show", y, r));
|
|
3132
|
+
const v = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/show\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
3133
|
+
e = e.replace(v, (z, S, y) => B("show", y, r));
|
|
3134
|
+
const M = /<a[^>]*href="(https?:\/\/music\.apple\.com\/([a-z]{2})\/([a-z-]+)\/[^\/]+\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3135
|
+
e = e.replace(M, (z, S, y, C, x) => kt(y, C, x));
|
|
3136
|
+
const $ = new RegExp(`(?<!["'=])(https?:\\/\\/music\\.apple\\.com\\/([a-z]{2})\\/([a-z-]+)\\/[^\\/\\s]+\\/(\\d+))(?!["'])`, "gi");
|
|
3137
|
+
e = e.replace($, (z, S, y, C, x) => kt(y, C, x));
|
|
3138
|
+
for (let z = a.length - 1; z >= 0; z--)
|
|
3139
|
+
e = e.replace(`__PROTECTED_${z}__`, a[z]);
|
|
2922
3140
|
return e;
|
|
2923
3141
|
}
|
|
2924
3142
|
function ds(e) {
|
|
@@ -2929,7 +3147,7 @@ function de(e) {
|
|
|
2929
3147
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2930
3148
|
}
|
|
2931
3149
|
function vt(e) {
|
|
2932
|
-
const t =
|
|
3150
|
+
const t = cs(), r = decodeURIComponent(e.split("/").pop().split("?")[0]), a = ds(e);
|
|
2933
3151
|
return `
|
|
2934
3152
|
<div class="artifactuse-audio-player" data-player-id="${t}" data-audio-src="${de(e)}">
|
|
2935
3153
|
<!-- Hidden audio element -->
|
|
@@ -3032,7 +3250,7 @@ function yt(e) {
|
|
|
3032
3250
|
</div>
|
|
3033
3251
|
`;
|
|
3034
3252
|
}
|
|
3035
|
-
function
|
|
3253
|
+
function B(e, t, r = "dark") {
|
|
3036
3254
|
const s = {
|
|
3037
3255
|
track: 152,
|
|
3038
3256
|
album: 352,
|
|
@@ -3078,7 +3296,7 @@ function ps(e = document) {
|
|
|
3078
3296
|
function fs(e) {
|
|
3079
3297
|
const t = e.dataset.playerId, r = e.dataset.audioSrc;
|
|
3080
3298
|
if (!t || !r) return;
|
|
3081
|
-
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"),
|
|
3299
|
+
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"), m = e.querySelector(".artifactuse-audio-icon-volume"), h = e.querySelector(".artifactuse-audio-icon-muted"), g = e.querySelector(".artifactuse-audio-volume-slider"), f = e.querySelector(".artifactuse-audio-speed-btn");
|
|
3082
3300
|
if (!a) return;
|
|
3083
3301
|
const b = {
|
|
3084
3302
|
isPlaying: !1,
|
|
@@ -3090,55 +3308,55 @@ function fs(e) {
|
|
|
3090
3308
|
waveformData: null
|
|
3091
3309
|
};
|
|
3092
3310
|
Y.set(t, { playerEl: e, audio: a, state: b }), hs(d, t), s == null || s.addEventListener("click", () => {
|
|
3093
|
-
b.isPlaying ?
|
|
3311
|
+
b.isPlaying ? At(t) : zt(t);
|
|
3094
3312
|
}), a.addEventListener("loadedmetadata", () => {
|
|
3095
|
-
b.duration = a.duration, u.textContent =
|
|
3313
|
+
b.duration = a.duration, u.textContent = $t(a.duration);
|
|
3096
3314
|
}), a.addEventListener("timeupdate", () => {
|
|
3097
|
-
b.currentTime = a.currentTime, i.textContent =
|
|
3098
|
-
const
|
|
3099
|
-
p.style.width = `${
|
|
3315
|
+
b.currentTime = a.currentTime, i.textContent = $t(a.currentTime);
|
|
3316
|
+
const v = a.currentTime / a.duration * 100;
|
|
3317
|
+
p.style.width = `${v}%`;
|
|
3100
3318
|
}), a.addEventListener("ended", () => {
|
|
3101
3319
|
b.isPlaying = !1, n.style.display = "", o.style.display = "none", e.classList.remove("is-playing"), p.style.width = "0%";
|
|
3102
3320
|
}), a.addEventListener("play", () => {
|
|
3103
3321
|
b.isPlaying = !0, n.style.display = "none", o.style.display = "", e.classList.add("is-playing"), gs(t);
|
|
3104
3322
|
}), a.addEventListener("pause", () => {
|
|
3105
3323
|
b.isPlaying = !1, n.style.display = "", o.style.display = "none", e.classList.remove("is-playing");
|
|
3106
|
-
}),
|
|
3107
|
-
const
|
|
3108
|
-
isNaN(
|
|
3109
|
-
}),
|
|
3110
|
-
const
|
|
3111
|
-
w.style.width = `${
|
|
3112
|
-
}),
|
|
3324
|
+
}), l == null || l.addEventListener("click", (v) => {
|
|
3325
|
+
const M = l.getBoundingClientRect(), S = (v.clientX - M.left) / M.width * a.duration;
|
|
3326
|
+
isNaN(S) || (a.currentTime = S);
|
|
3327
|
+
}), l == null || l.addEventListener("mousemove", (v) => {
|
|
3328
|
+
const M = l.getBoundingClientRect(), z = (v.clientX - M.left) / M.width * 100;
|
|
3329
|
+
w.style.width = `${z}%`;
|
|
3330
|
+
}), l == null || l.addEventListener("mouseleave", () => {
|
|
3113
3331
|
w.style.width = "0%";
|
|
3114
|
-
}),
|
|
3332
|
+
}), c == null || c.addEventListener("click", () => {
|
|
3115
3333
|
b.isMuted = !b.isMuted, a.muted = b.isMuted, m.style.display = b.isMuted ? "none" : "", h.style.display = b.isMuted ? "" : "none", b.isMuted ? g.value = 0 : g.value = b.volume * 100;
|
|
3116
|
-
}), g == null || g.addEventListener("input", (
|
|
3117
|
-
const
|
|
3118
|
-
b.volume =
|
|
3334
|
+
}), g == null || g.addEventListener("input", (v) => {
|
|
3335
|
+
const M = parseInt(v.target.value, 10) / 100;
|
|
3336
|
+
b.volume = M, a.volume = M, M === 0 ? (b.isMuted = !0, m.style.display = "none", h.style.display = "") : (b.isMuted = !1, a.muted = !1, m.style.display = "", h.style.display = "none");
|
|
3119
3337
|
}), f == null || f.addEventListener("click", () => {
|
|
3120
|
-
const
|
|
3121
|
-
b.playbackRate = je[
|
|
3122
|
-
}), e.addEventListener("keydown", (
|
|
3123
|
-
switch (
|
|
3338
|
+
const M = (je.indexOf(b.playbackRate) + 1) % je.length;
|
|
3339
|
+
b.playbackRate = je[M], a.playbackRate = b.playbackRate, f.querySelector("span").textContent = `${b.playbackRate}x`;
|
|
3340
|
+
}), e.addEventListener("keydown", (v) => {
|
|
3341
|
+
switch (v.key) {
|
|
3124
3342
|
case " ":
|
|
3125
3343
|
case "k":
|
|
3126
|
-
|
|
3344
|
+
v.preventDefault(), b.isPlaying ? At(t) : zt(t);
|
|
3127
3345
|
break;
|
|
3128
3346
|
case "ArrowLeft":
|
|
3129
|
-
|
|
3347
|
+
v.preventDefault(), a.currentTime = Math.max(0, a.currentTime - 5);
|
|
3130
3348
|
break;
|
|
3131
3349
|
case "ArrowRight":
|
|
3132
|
-
|
|
3350
|
+
v.preventDefault(), a.currentTime = Math.min(a.duration, a.currentTime + 5);
|
|
3133
3351
|
break;
|
|
3134
3352
|
case "ArrowUp":
|
|
3135
|
-
|
|
3353
|
+
v.preventDefault(), b.volume = Math.min(1, b.volume + 0.1), a.volume = b.volume, g.value = b.volume * 100;
|
|
3136
3354
|
break;
|
|
3137
3355
|
case "ArrowDown":
|
|
3138
|
-
|
|
3356
|
+
v.preventDefault(), b.volume = Math.max(0, b.volume - 0.1), a.volume = b.volume, g.value = b.volume * 100;
|
|
3139
3357
|
break;
|
|
3140
3358
|
case "m":
|
|
3141
|
-
|
|
3359
|
+
v.preventDefault(), c == null || c.click();
|
|
3142
3360
|
break;
|
|
3143
3361
|
}
|
|
3144
3362
|
}), e.setAttribute("data-initialized", "true"), e.setAttribute("tabindex", "0");
|
|
@@ -3148,11 +3366,11 @@ function hs(e, t) {
|
|
|
3148
3366
|
const r = e.getContext("2d"), a = window.devicePixelRatio || 1, s = e.parentElement.getBoundingClientRect();
|
|
3149
3367
|
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);
|
|
3150
3368
|
const n = s.width, o = s.height, i = Math.floor(n / 4), u = xt(i, t);
|
|
3151
|
-
|
|
3369
|
+
Mt(r, u, n, o), new ResizeObserver(() => {
|
|
3152
3370
|
const d = e.parentElement.getBoundingClientRect();
|
|
3153
3371
|
e.width = d.width * a, e.height = d.height * a, e.style.width = `${d.width}px`, e.style.height = `${d.height}px`, r.scale(a, a);
|
|
3154
3372
|
const p = Math.floor(d.width / 4), w = xt(p, t);
|
|
3155
|
-
|
|
3373
|
+
Mt(r, w, d.width, d.height);
|
|
3156
3374
|
}).observe(e.parentElement);
|
|
3157
3375
|
}
|
|
3158
3376
|
function xt(e, t) {
|
|
@@ -3172,24 +3390,24 @@ function xt(e, t) {
|
|
|
3172
3390
|
}
|
|
3173
3391
|
return r;
|
|
3174
3392
|
}
|
|
3175
|
-
function
|
|
3393
|
+
function Mt(e, t, r, a) {
|
|
3176
3394
|
e.clearRect(0, 0, r, a);
|
|
3177
|
-
const s = 2, o = s + 2, i = a / 2,
|
|
3178
|
-
e.fillStyle = `rgba(${
|
|
3179
|
-
const w = p * o,
|
|
3180
|
-
e.beginPath(), e.roundRect(w, i - m, s,
|
|
3395
|
+
const s = 2, o = s + 2, i = a / 2, l = getComputedStyle(document.documentElement).getPropertyValue("--artifactuse-text-muted").trim() || "107, 114, 128";
|
|
3396
|
+
e.fillStyle = `rgba(${l}, 0.4)`, t.forEach((d, p) => {
|
|
3397
|
+
const w = p * o, c = d * (a * 0.8), m = c / 2, h = s / 2;
|
|
3398
|
+
e.beginPath(), e.roundRect(w, i - m, s, c, h), e.fill();
|
|
3181
3399
|
});
|
|
3182
3400
|
}
|
|
3183
|
-
function
|
|
3401
|
+
function $t(e) {
|
|
3184
3402
|
if (!e || isNaN(e)) return "0:00";
|
|
3185
3403
|
const t = Math.floor(e / 3600), r = Math.floor(e % 3600 / 60), a = Math.floor(e % 60);
|
|
3186
3404
|
return t > 0 ? `${t}:${r.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}` : `${r}:${a.toString().padStart(2, "0")}`;
|
|
3187
3405
|
}
|
|
3188
|
-
function
|
|
3406
|
+
function zt(e) {
|
|
3189
3407
|
const t = Y.get(e);
|
|
3190
3408
|
t && t.audio.play();
|
|
3191
3409
|
}
|
|
3192
|
-
function
|
|
3410
|
+
function At(e) {
|
|
3193
3411
|
const t = Y.get(e);
|
|
3194
3412
|
t && t.audio.pause();
|
|
3195
3413
|
}
|
|
@@ -3222,48 +3440,48 @@ function bs(e) {
|
|
|
3222
3440
|
const r = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/embed\?pb=[^"]+)"[^>]*>[^<]*<\/a>/gi;
|
|
3223
3441
|
e = e.replace(r, (g, f) => {
|
|
3224
3442
|
const b = `__PROTECTED_MAP_${t.length}__`;
|
|
3225
|
-
return t.push(
|
|
3443
|
+
return t.push(St(f)), b;
|
|
3226
3444
|
});
|
|
3227
3445
|
const a = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/embed\\?pb=[^\\s<>"]+)(?!["'])`, "gi");
|
|
3228
3446
|
e = e.replace(a, (g, f) => {
|
|
3229
3447
|
const b = `__PROTECTED_MAP_${t.length}__`;
|
|
3230
|
-
return t.push(
|
|
3448
|
+
return t.push(St(f)), b;
|
|
3231
3449
|
});
|
|
3232
3450
|
const s = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/place\/([^\/\?"]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3233
|
-
e = e.replace(s, (g, f, b) =>
|
|
3451
|
+
e = e.replace(s, (g, f, b) => X(decodeURIComponent(b.replace(/\+/g, " "))));
|
|
3234
3452
|
const n = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/place\\/([^\\/\\?\\s]+))(?!["'])`, "gi");
|
|
3235
|
-
e = e.replace(n, (g, f, b) =>
|
|
3453
|
+
e = e.replace(n, (g, f, b) => X(decodeURIComponent(b.replace(/\+/g, " "))));
|
|
3236
3454
|
const o = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/@([0-9.-]+),([0-9.-]+),([0-9]+)z[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3237
|
-
e = e.replace(o, (g, f, b,
|
|
3455
|
+
e = e.replace(o, (g, f, b, v, M) => Ue(b, v, M));
|
|
3238
3456
|
const i = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/@([0-9.-]+),([0-9.-]+),([0-9]+)z)(?!["'])`, "gi");
|
|
3239
|
-
e = e.replace(i, (g, f, b,
|
|
3457
|
+
e = e.replace(i, (g, f, b, v, M) => Ue(b, v, M));
|
|
3240
3458
|
const u = /<a[^>]*href="(https?:\/\/maps\.google\.com\/\?q=([^\s"&]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3241
|
-
e = e.replace(u, (g, f, b) =>
|
|
3242
|
-
const
|
|
3243
|
-
e = e.replace(
|
|
3459
|
+
e = e.replace(u, (g, f, b) => X(decodeURIComponent(b)));
|
|
3460
|
+
const l = new RegExp(`(?<!["'=])(https?:\\/\\/maps\\.google\\.com\\/\\?q=([^\\s"&]+))(?!["'])`, "gi");
|
|
3461
|
+
e = e.replace(l, (g, f, b) => X(decodeURIComponent(b)));
|
|
3244
3462
|
const d = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/search\/([^\/\?"]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3245
|
-
e = e.replace(d, (g, f, b) =>
|
|
3463
|
+
e = e.replace(d, (g, f, b) => X(decodeURIComponent(b.replace(/\+/g, " "))));
|
|
3246
3464
|
const p = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/search\\/([^\\/\\?\\s]+))(?!["'])`, "gi");
|
|
3247
|
-
e = e.replace(p, (g, f, b) =>
|
|
3465
|
+
e = e.replace(p, (g, f, b) => X(decodeURIComponent(b.replace(/\+/g, " "))));
|
|
3248
3466
|
const w = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/search\/\?[^"]*query=([^"&]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3249
|
-
e = e.replace(w, (g, f, b) =>
|
|
3250
|
-
const
|
|
3251
|
-
e = e.replace(
|
|
3467
|
+
e = e.replace(w, (g, f, b) => X(decodeURIComponent(b.replace(/\+/g, " "))));
|
|
3468
|
+
const c = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/search\\/\\?[^\\s"]*query=([^\\s"&]+))(?!["'])`, "gi");
|
|
3469
|
+
e = e.replace(c, (g, f, b) => X(decodeURIComponent(b.replace(/\+/g, " "))));
|
|
3252
3470
|
const m = /<a[^>]*href="(https?:\/\/(?:www\.)?openstreetmap\.org\/[^"]*mlat=([0-9.-]+)[^"]*mlon=([0-9.-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3253
|
-
e = e.replace(m, (g, f, b,
|
|
3254
|
-
const
|
|
3255
|
-
return
|
|
3471
|
+
e = e.replace(m, (g, f, b, v) => {
|
|
3472
|
+
const M = f.match(/#map=(\d+)/), $ = M ? M[1] : 15;
|
|
3473
|
+
return Ct(b, v, $);
|
|
3256
3474
|
});
|
|
3257
3475
|
const h = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?openstreetmap\\.org\\/[^\\s]*mlat=([0-9.-]+)[^\\s]*mlon=([0-9.-]+))(?!["'])`, "gi");
|
|
3258
|
-
e = e.replace(h, (g, f, b,
|
|
3259
|
-
const
|
|
3260
|
-
return
|
|
3476
|
+
e = e.replace(h, (g, f, b, v) => {
|
|
3477
|
+
const M = f.match(/#map=(\d+)/), $ = M ? M[1] : 15;
|
|
3478
|
+
return Ct(b, v, $);
|
|
3261
3479
|
});
|
|
3262
3480
|
for (let g = t.length - 1; g >= 0; g--)
|
|
3263
3481
|
e = e.replace(`__PROTECTED_MAP_${g}__`, t[g]);
|
|
3264
3482
|
return e;
|
|
3265
3483
|
}
|
|
3266
|
-
function
|
|
3484
|
+
function St(e) {
|
|
3267
3485
|
const t = e.match(/pb=([^&]+)/);
|
|
3268
3486
|
if (t) {
|
|
3269
3487
|
const r = decodeURIComponent(t[1]), a = r.match(/!3d(-?[\d.]+).*?!2d(-?[\d.]+)/), s = r.match(/!2d(-?[\d.]+).*?!3d(-?[\d.]+)/);
|
|
@@ -3272,8 +3490,8 @@ function zt(e) {
|
|
|
3272
3490
|
const i = r.match(/!1d([\d.]+)/);
|
|
3273
3491
|
let u = 15;
|
|
3274
3492
|
if (i) {
|
|
3275
|
-
const
|
|
3276
|
-
|
|
3493
|
+
const l = parseFloat(i[1]);
|
|
3494
|
+
l > 1e4 ? u = 10 : l > 5e3 ? u = 12 : l > 1e3 ? u = 14 : l > 500 ? u = 16 : u = 18;
|
|
3277
3495
|
}
|
|
3278
3496
|
return Ue(n, o, u);
|
|
3279
3497
|
}
|
|
@@ -3291,7 +3509,7 @@ function zt(e) {
|
|
|
3291
3509
|
</div>
|
|
3292
3510
|
`;
|
|
3293
3511
|
}
|
|
3294
|
-
function
|
|
3512
|
+
function X(e) {
|
|
3295
3513
|
const t = encodeURIComponent(e);
|
|
3296
3514
|
return `
|
|
3297
3515
|
<div class="artifactuse-map-wrapper">
|
|
@@ -3335,7 +3553,7 @@ function Ue(e, t, r) {
|
|
|
3335
3553
|
</div>
|
|
3336
3554
|
`;
|
|
3337
3555
|
}
|
|
3338
|
-
function
|
|
3556
|
+
function Ct(e, t, r = 15) {
|
|
3339
3557
|
return `
|
|
3340
3558
|
<div class="artifactuse-map-wrapper">
|
|
3341
3559
|
<iframe
|
|
@@ -3353,39 +3571,39 @@ function Lt(e, t, r = 15) {
|
|
|
3353
3571
|
}
|
|
3354
3572
|
function vs(e, t = {}) {
|
|
3355
3573
|
const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/(?:www\.)?(?:twitter\.com|x\.com)\/([a-zA-Z0-9_]+)\/status\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3356
|
-
e = e.replace(a, (
|
|
3574
|
+
e = e.replace(a, (v, M, $, z) => Rt($, z, r));
|
|
3357
3575
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?(?:twitter\\.com|x\\.com)\\/([a-zA-Z0-9_]+)\\/status\\/(\\d+))(?!["'])`, "gi");
|
|
3358
|
-
e = e.replace(s, (
|
|
3576
|
+
e = e.replace(s, (v, M, $, z) => Rt($, z, r));
|
|
3359
3577
|
const n = /<a[^>]*href="(https?:\/\/(?:www\.)?instagram\.com\/p\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3360
|
-
e = e.replace(n, (
|
|
3578
|
+
e = e.replace(n, (v, M, $) => Lt($));
|
|
3361
3579
|
const o = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?instagram\\.com\\/p\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
|
|
3362
|
-
e = e.replace(o, (
|
|
3580
|
+
e = e.replace(o, (v, M, $) => Lt($));
|
|
3363
3581
|
const i = /<a[^>]*href="(https?:\/\/(?:www\.)?instagram\.com\/reel\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3364
|
-
e = e.replace(i, (
|
|
3582
|
+
e = e.replace(i, (v, M, $) => Tt($));
|
|
3365
3583
|
const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?instagram\\.com\\/reel\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
|
|
3366
|
-
e = e.replace(u, (
|
|
3367
|
-
const
|
|
3368
|
-
e = e.replace(
|
|
3584
|
+
e = e.replace(u, (v, M, $) => Tt($));
|
|
3585
|
+
const l = /<a[^>]*href="(https?:\/\/(?:www\.)?tiktok\.com\/@([a-zA-Z0-9_.]+)\/video\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3586
|
+
e = e.replace(l, (v, M, $, z) => _t(z));
|
|
3369
3587
|
const d = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?tiktok\\.com\\/@([a-zA-Z0-9_.]+)\\/video\\/(\\d+))(?!["'])`, "gi");
|
|
3370
|
-
e = e.replace(d, (
|
|
3588
|
+
e = e.replace(d, (v, M, $, z) => _t(z));
|
|
3371
3589
|
const p = /<a[^>]*href="(https?:\/\/(?:www\.)?linkedin\.com\/(?:posts|feed\/update)\/([a-zA-Z0-9_:-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3372
|
-
e = e.replace(p, (
|
|
3590
|
+
e = e.replace(p, (v, M, $) => Et($, M));
|
|
3373
3591
|
const w = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?linkedin\\.com\\/(?:posts|feed\\/update)\\/([a-zA-Z0-9_:-]+))(?!["'])`, "gi");
|
|
3374
|
-
e = e.replace(w, (
|
|
3375
|
-
const
|
|
3376
|
-
e = e.replace(
|
|
3592
|
+
e = e.replace(w, (v, M, $) => Et($, M));
|
|
3593
|
+
const c = /<a[^>]*href="(https?:\/\/(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3594
|
+
e = e.replace(c, (v, M, $, z) => Pt($, z, M));
|
|
3377
3595
|
const m = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?reddit\\.com\\/r\\/([a-zA-Z0-9_]+)\\/comments\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
3378
|
-
e = e.replace(m, (
|
|
3596
|
+
e = e.replace(m, (v, M, $, z) => Pt($, z, M));
|
|
3379
3597
|
const h = /<a[^>]*href="(https?:\/\/(?:www\.)?facebook\.com\/[a-zA-Z0-9.]+\/posts\/\d+[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3380
|
-
e = e.replace(h, (
|
|
3598
|
+
e = e.replace(h, (v, M) => jt(M));
|
|
3381
3599
|
const g = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?facebook\\.com\\/[a-zA-Z0-9.]+\\/posts\\/\\d+)(?!["'])`, "gi");
|
|
3382
|
-
e = e.replace(g, (
|
|
3600
|
+
e = e.replace(g, (v, M) => jt(M));
|
|
3383
3601
|
const f = /<a[^>]*href="(https?:\/\/(?:www\.)?pinterest\.com\/pin\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3384
|
-
e = e.replace(f, (
|
|
3602
|
+
e = e.replace(f, (v, M, $) => Ht($));
|
|
3385
3603
|
const b = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?pinterest\\.com\\/pin\\/(\\d+))(?!["'])`, "gi");
|
|
3386
|
-
return e = e.replace(b, (
|
|
3604
|
+
return e = e.replace(b, (v, M, $) => Ht($)), e;
|
|
3387
3605
|
}
|
|
3388
|
-
function
|
|
3606
|
+
function Rt(e, t, r = "dark") {
|
|
3389
3607
|
return `
|
|
3390
3608
|
<div class="artifactuse-twitter-wrapper">
|
|
3391
3609
|
<blockquote class="twitter-tweet" data-dnt="true" data-theme="${r}">
|
|
@@ -3395,7 +3613,7 @@ function Ct(e, t, r = "dark") {
|
|
|
3395
3613
|
</div>
|
|
3396
3614
|
`;
|
|
3397
3615
|
}
|
|
3398
|
-
function
|
|
3616
|
+
function Lt(e) {
|
|
3399
3617
|
return `
|
|
3400
3618
|
<div class="artifactuse-instagram-wrapper">
|
|
3401
3619
|
<iframe
|
|
@@ -3409,7 +3627,7 @@ function Mt(e) {
|
|
|
3409
3627
|
</div>
|
|
3410
3628
|
`;
|
|
3411
3629
|
}
|
|
3412
|
-
function
|
|
3630
|
+
function Tt(e) {
|
|
3413
3631
|
return `
|
|
3414
3632
|
<div class="artifactuse-instagram-wrapper">
|
|
3415
3633
|
<iframe
|
|
@@ -3423,7 +3641,7 @@ function _t(e) {
|
|
|
3423
3641
|
</div>
|
|
3424
3642
|
`;
|
|
3425
3643
|
}
|
|
3426
|
-
function
|
|
3644
|
+
function _t(e) {
|
|
3427
3645
|
return `
|
|
3428
3646
|
<div class="artifactuse-tiktok-wrapper">
|
|
3429
3647
|
<iframe
|
|
@@ -3485,7 +3703,7 @@ function jt(e) {
|
|
|
3485
3703
|
</div>
|
|
3486
3704
|
`;
|
|
3487
3705
|
}
|
|
3488
|
-
function
|
|
3706
|
+
function Ht(e) {
|
|
3489
3707
|
return `
|
|
3490
3708
|
<div class="artifactuse-pinterest-wrapper">
|
|
3491
3709
|
<a data-pin-do="embedPin" data-pin-width="large" href="https://www.pinterest.com/pin/${e}/"></a>
|
|
@@ -3495,11 +3713,11 @@ function It(e) {
|
|
|
3495
3713
|
}
|
|
3496
3714
|
function ys(e) {
|
|
3497
3715
|
const t = /<a[^>]*href="(https?:\/\/[^"]+\.pdf(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
|
|
3498
|
-
e = e.replace(t, (a, s) =>
|
|
3716
|
+
e = e.replace(t, (a, s) => Vt(s));
|
|
3499
3717
|
const r = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.pdf(?:\\?[^\\s<>"]*)?)(?!["'])`, "gi");
|
|
3500
|
-
return e = e.replace(r, (a, s) =>
|
|
3718
|
+
return e = e.replace(r, (a, s) => Vt(s)), e;
|
|
3501
3719
|
}
|
|
3502
|
-
function
|
|
3720
|
+
function Vt(e) {
|
|
3503
3721
|
return `
|
|
3504
3722
|
<div class="artifactuse-pdf-wrapper">
|
|
3505
3723
|
<div class="artifactuse-pdf-header">
|
|
@@ -3525,21 +3743,21 @@ function Dt(e) {
|
|
|
3525
3743
|
}
|
|
3526
3744
|
function ks(e) {
|
|
3527
3745
|
const t = /<a[^>]*href="(https?:\/\/docs\.google\.com\/document\/d\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3528
|
-
e = e.replace(t, (
|
|
3746
|
+
e = e.replace(t, (l, d, p) => se(p, "document"));
|
|
3529
3747
|
const r = new RegExp(`(?<!["'=])(https?:\\/\\/docs\\.google\\.com\\/document\\/d\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
|
|
3530
|
-
e = e.replace(r, (
|
|
3748
|
+
e = e.replace(r, (l, d, p) => se(p, "document"));
|
|
3531
3749
|
const a = /<a[^>]*href="(https?:\/\/docs\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3532
|
-
e = e.replace(a, (
|
|
3750
|
+
e = e.replace(a, (l, d, p) => se(p, "spreadsheets"));
|
|
3533
3751
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/docs\\.google\\.com\\/spreadsheets\\/d\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
|
|
3534
|
-
e = e.replace(s, (
|
|
3752
|
+
e = e.replace(s, (l, d, p) => se(p, "spreadsheets"));
|
|
3535
3753
|
const n = /<a[^>]*href="(https?:\/\/docs\.google\.com\/presentation\/d\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3536
|
-
e = e.replace(n, (
|
|
3754
|
+
e = e.replace(n, (l, d, p) => se(p, "presentation"));
|
|
3537
3755
|
const o = new RegExp(`(?<!["'=])(https?:\\/\\/docs\\.google\\.com\\/presentation\\/d\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
|
|
3538
|
-
e = e.replace(o, (
|
|
3756
|
+
e = e.replace(o, (l, d, p) => se(p, "presentation"));
|
|
3539
3757
|
const i = /<a[^>]*href="(https?:\/\/docs\.google\.com\/forms\/d\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3540
|
-
e = e.replace(i, (
|
|
3758
|
+
e = e.replace(i, (l, d, p) => It(p));
|
|
3541
3759
|
const u = new RegExp(`(?<!["'=])(https?:\\/\\/docs\\.google\\.com\\/forms\\/d\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
|
|
3542
|
-
return e = e.replace(u, (
|
|
3760
|
+
return e = e.replace(u, (l, d, p) => It(p)), e;
|
|
3543
3761
|
}
|
|
3544
3762
|
function se(e, t) {
|
|
3545
3763
|
const r = {
|
|
@@ -3572,7 +3790,7 @@ function se(e, t) {
|
|
|
3572
3790
|
</div>
|
|
3573
3791
|
`;
|
|
3574
3792
|
}
|
|
3575
|
-
function
|
|
3793
|
+
function It(e) {
|
|
3576
3794
|
return `
|
|
3577
3795
|
<div class="artifactuse-google-form-wrapper">
|
|
3578
3796
|
<iframe
|
|
@@ -3585,11 +3803,11 @@ function Ht(e) {
|
|
|
3585
3803
|
}
|
|
3586
3804
|
function xs(e) {
|
|
3587
3805
|
const t = /<a[^>]*href="(https?:\/\/[^"]+\.(docx?|xlsx?|pptx?)(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
|
|
3588
|
-
e = e.replace(t, (a, s) =>
|
|
3806
|
+
e = e.replace(t, (a, s) => Dt(s));
|
|
3589
3807
|
const r = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(docx?|xlsx?|pptx?)(?:\\?[^\\s<>"]*)?)(?!["'])`, "gi");
|
|
3590
|
-
return e = e.replace(r, (a, s) =>
|
|
3808
|
+
return e = e.replace(r, (a, s) => Dt(s)), e;
|
|
3591
3809
|
}
|
|
3592
|
-
function
|
|
3810
|
+
function Dt(e) {
|
|
3593
3811
|
const t = encodeURIComponent(e), r = e.split("/").pop().split("?")[0], a = r.split(".").pop().toLowerCase();
|
|
3594
3812
|
return `
|
|
3595
3813
|
<div class="artifactuse-office-wrapper">
|
|
@@ -3615,43 +3833,43 @@ function qt(e) {
|
|
|
3615
3833
|
</div>
|
|
3616
3834
|
`;
|
|
3617
3835
|
}
|
|
3618
|
-
function
|
|
3836
|
+
function Ms(e) {
|
|
3619
3837
|
return `${e}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
3620
3838
|
}
|
|
3621
|
-
function
|
|
3839
|
+
function $s(e, t = {}) {
|
|
3622
3840
|
const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/gist\.github\.com\/([a-zA-Z0-9_-]+)\/([a-f0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3623
|
-
e = e.replace(a, (h, g, f, b) =>
|
|
3841
|
+
e = e.replace(a, (h, g, f, b) => qt(f, b));
|
|
3624
3842
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/gist\\.github\\.com\\/([a-zA-Z0-9_-]+)\\/([a-f0-9]+))(?!["'])`, "gi");
|
|
3625
|
-
e = e.replace(s, (h, g, f, b) =>
|
|
3843
|
+
e = e.replace(s, (h, g, f, b) => qt(f, b));
|
|
3626
3844
|
const n = /<a[^>]*href="(https?:\/\/codepen\.io\/([a-zA-Z0-9_-]+)\/(?:pen|full|details)\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3627
|
-
e = e.replace(n, (h, g, f, b) =>
|
|
3845
|
+
e = e.replace(n, (h, g, f, b) => Zt(f, b, r));
|
|
3628
3846
|
const o = new RegExp(`(?<!["'=])(https?:\\/\\/codepen\\.io\\/([a-zA-Z0-9_-]+)\\/(?:pen|full|details)\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
3629
|
-
e = e.replace(o, (h, g, f, b) =>
|
|
3847
|
+
e = e.replace(o, (h, g, f, b) => Zt(f, b, r));
|
|
3630
3848
|
const i = /<a[^>]*href="(https?:\/\/codesandbox\.io\/(?:s|embed)\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3631
3849
|
e = e.replace(i, (h, g, f) => Ot(f, r));
|
|
3632
3850
|
const u = new RegExp(`(?<!["'=])(https?:\\/\\/codesandbox\\.io\\/(?:s|embed)\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
|
|
3633
3851
|
e = e.replace(u, (h, g, f) => Ot(f, r));
|
|
3634
|
-
const
|
|
3635
|
-
e = e.replace(
|
|
3852
|
+
const l = /<a[^>]*href="(https?:\/\/jsfiddle\.net\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3853
|
+
e = e.replace(l, (h, g, f, b) => Bt(f, b, r));
|
|
3636
3854
|
const d = new RegExp(`(?<!["'=])(https?:\\/\\/jsfiddle\\.net\\/([a-zA-Z0-9_]+)\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
3637
|
-
e = e.replace(d, (h, g, f, b) =>
|
|
3855
|
+
e = e.replace(d, (h, g, f, b) => Bt(f, b, r));
|
|
3638
3856
|
const p = /<a[^>]*href="(https?:\/\/stackblitz\.com\/(?:edit|embed)\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3639
3857
|
e = e.replace(p, (h, g, f) => Ft(f, r));
|
|
3640
3858
|
const w = new RegExp(`(?<!["'=])(https?:\\/\\/stackblitz\\.com\\/(?:edit|embed)\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
|
|
3641
3859
|
e = e.replace(w, (h, g, f) => Ft(f, r));
|
|
3642
|
-
const
|
|
3643
|
-
e = e.replace(
|
|
3860
|
+
const c = /<a[^>]*href="(https?:\/\/replit\.com\/@([a-zA-Z0-9_]+)\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3861
|
+
e = e.replace(c, (h, g, f, b) => Nt(f, b, r));
|
|
3644
3862
|
const m = new RegExp(`(?<!["'=])(https?:\\/\\/replit\\.com\\/@([a-zA-Z0-9_]+)\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
|
|
3645
3863
|
return e = e.replace(m, (h, g, f, b) => Nt(f, b, r)), e;
|
|
3646
3864
|
}
|
|
3647
|
-
function
|
|
3865
|
+
function qt(e, t) {
|
|
3648
3866
|
return `
|
|
3649
|
-
<div class="artifactuse-gist-wrapper" id="${
|
|
3867
|
+
<div class="artifactuse-gist-wrapper" id="${Ms("gist")}">
|
|
3650
3868
|
<script src="https://gist.github.com/${e}/${t}.js"><\/script>
|
|
3651
3869
|
</div>
|
|
3652
3870
|
`;
|
|
3653
3871
|
}
|
|
3654
|
-
function
|
|
3872
|
+
function Zt(e, t, r = "dark") {
|
|
3655
3873
|
return `
|
|
3656
3874
|
<div class="artifactuse-codepen-wrapper">
|
|
3657
3875
|
<iframe
|
|
@@ -3682,7 +3900,7 @@ function Ot(e, t = "dark") {
|
|
|
3682
3900
|
</div>
|
|
3683
3901
|
`;
|
|
3684
3902
|
}
|
|
3685
|
-
function
|
|
3903
|
+
function Bt(e, t, r = "dark") {
|
|
3686
3904
|
return `
|
|
3687
3905
|
<div class="artifactuse-jsfiddle-wrapper">
|
|
3688
3906
|
<iframe
|
|
@@ -3721,23 +3939,23 @@ function Nt(e, t, r = "dark") {
|
|
|
3721
3939
|
</div>
|
|
3722
3940
|
`;
|
|
3723
3941
|
}
|
|
3724
|
-
function
|
|
3942
|
+
function zs(e) {
|
|
3725
3943
|
const t = /<a[^>]*href="(https?:\/\/public\.tableau\.com\/(?:views|profile)\/([^\s"]+))"[^>]*>[^<]*<\/a>/gi;
|
|
3726
|
-
e = e.replace(t, (
|
|
3944
|
+
e = e.replace(t, (l, d, p) => Ut(p));
|
|
3727
3945
|
const r = new RegExp(`(?<!["'=])(https?:\\/\\/public\\.tableau\\.com\\/(?:views|profile)\\/([^\\s<>"]+))(?!["'])`, "gi");
|
|
3728
|
-
e = e.replace(r, (
|
|
3946
|
+
e = e.replace(r, (l, d, p) => Ut(p));
|
|
3729
3947
|
const a = /<a[^>]*href="(https?:\/\/(?:public\.)?flourish\.studio\/visualisation\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3730
|
-
e = e.replace(a, (
|
|
3948
|
+
e = e.replace(a, (l, d, p) => Gt(p));
|
|
3731
3949
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/(?:public\\.)?flourish\\.studio\\/visualisation\\/(\\d+))(?!["'])`, "gi");
|
|
3732
|
-
e = e.replace(s, (
|
|
3950
|
+
e = e.replace(s, (l, d, p) => Gt(p));
|
|
3733
3951
|
const n = /<a[^>]*href="(https?:\/\/datawrapper\.dwcdn\.net\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3734
|
-
e = e.replace(n, (
|
|
3952
|
+
e = e.replace(n, (l, d, p) => Wt(p));
|
|
3735
3953
|
const o = new RegExp(`(?<!["'=])(https?:\\/\\/datawrapper\\.dwcdn\\.net\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
3736
|
-
e = e.replace(o, (
|
|
3954
|
+
e = e.replace(o, (l, d, p) => Wt(p));
|
|
3737
3955
|
const i = /<a[^>]*href="(https?:\/\/(?:e\.)?infogram\.com\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3738
|
-
e = e.replace(i, (
|
|
3956
|
+
e = e.replace(i, (l, d, p) => Xt(p));
|
|
3739
3957
|
const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:e\\.)?infogram\\.com\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
|
|
3740
|
-
return e = e.replace(u, (
|
|
3958
|
+
return e = e.replace(u, (l, d, p) => Xt(p)), e;
|
|
3741
3959
|
}
|
|
3742
3960
|
function Ut(e) {
|
|
3743
3961
|
return `
|
|
@@ -3788,7 +4006,7 @@ function Xt(e) {
|
|
|
3788
4006
|
</div>
|
|
3789
4007
|
`;
|
|
3790
4008
|
}
|
|
3791
|
-
function
|
|
4009
|
+
function As(e, t = {}) {
|
|
3792
4010
|
const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/sketchfab\.com\/(?:3d-)?models\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3793
4011
|
e = e.replace(a, (h, g, f) => Kt(f, r));
|
|
3794
4012
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/sketchfab\\.com\\/(?:3d-)?models\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
|
|
@@ -3801,16 +4019,16 @@ function Rs(e, t = {}) {
|
|
|
3801
4019
|
e = e.replace(i, (h, g, f) => Qt(f, g));
|
|
3802
4020
|
const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?figma\\.com\\/proto\\/([a-zA-Z0-9]+)[^\\s]*)(?!["'])`, "gi");
|
|
3803
4021
|
e = e.replace(u, (h, g, f) => Qt(f, g));
|
|
3804
|
-
const
|
|
3805
|
-
e = e.replace(
|
|
4022
|
+
const l = /<a[^>]*href="(https?:\/\/(?:www\.)?canva\.com\/design\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
4023
|
+
e = e.replace(l, (h, g, f) => Yt(f, g));
|
|
3806
4024
|
const d = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?canva\\.com\\/design\\/([a-zA-Z0-9_-]+)[^\\s]*)(?!["'])`, "gi");
|
|
3807
4025
|
e = e.replace(d, (h, g, f) => Yt(f, g));
|
|
3808
4026
|
const p = /<a[^>]*href="(https?:\/\/dribbble\.com\/shots\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3809
4027
|
e = e.replace(p, (h, g, f) => er(f));
|
|
3810
4028
|
const w = new RegExp(`(?<!["'=])(https?:\\/\\/dribbble\\.com\\/shots\\/(\\d+))(?!["'])`, "gi");
|
|
3811
4029
|
e = e.replace(w, (h, g, f) => er(f));
|
|
3812
|
-
const
|
|
3813
|
-
e = e.replace(
|
|
4030
|
+
const c = /<a[^>]*href="(https?:\/\/(?:www\.)?behance\.net\/gallery\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
4031
|
+
e = e.replace(c, (h, g, f) => tr(f, g));
|
|
3814
4032
|
const m = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?behance\\.net\\/gallery\\/(\\d+)[^\\s]*)(?!["'])`, "gi");
|
|
3815
4033
|
return e = e.replace(m, (h, g, f) => tr(f, g)), e;
|
|
3816
4034
|
}
|
|
@@ -3898,35 +4116,35 @@ function tr(e, t) {
|
|
|
3898
4116
|
</div>
|
|
3899
4117
|
`;
|
|
3900
4118
|
}
|
|
3901
|
-
function
|
|
4119
|
+
function Ss(e, t = {}) {
|
|
3902
4120
|
const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/(?:[a-zA-Z0-9-]+\.)?typeform\.com\/to\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3903
|
-
e = e.replace(a, (f, b,
|
|
4121
|
+
e = e.replace(a, (f, b, v) => rr(v));
|
|
3904
4122
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/(?:[a-zA-Z0-9-]+\\.)?typeform\\.com\\/to\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
3905
|
-
e = e.replace(s, (f, b,
|
|
4123
|
+
e = e.replace(s, (f, b, v) => rr(v));
|
|
3906
4124
|
const n = /<a[^>]*href="(https?:\/\/calendly\.com\/([a-zA-Z0-9_-]+)(?:\/([a-zA-Z0-9_-]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3907
|
-
e = e.replace(n, (f, b,
|
|
4125
|
+
e = e.replace(n, (f, b, v, M) => ar(v, M));
|
|
3908
4126
|
const o = new RegExp(`(?<!["'=])(https?:\\/\\/calendly\\.com\\/([a-zA-Z0-9_-]+)(?:\\/([a-zA-Z0-9_-]+))?)(?!["'])`, "gi");
|
|
3909
|
-
e = e.replace(o, (f, b,
|
|
4127
|
+
e = e.replace(o, (f, b, v, M) => ar(v, M));
|
|
3910
4128
|
const i = /<a[^>]*href="(https?:\/\/calendar\.google\.com\/calendar\/appointments\/schedules\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3911
|
-
e = e.replace(i, (f, b,
|
|
4129
|
+
e = e.replace(i, (f, b, v) => sr(v));
|
|
3912
4130
|
const u = new RegExp(`(?<!["'=])(https?:\\/\\/calendar\\.google\\.com\\/calendar\\/appointments\\/schedules\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
|
|
3913
|
-
e = e.replace(u, (f, b,
|
|
3914
|
-
const
|
|
3915
|
-
e = e.replace(
|
|
4131
|
+
e = e.replace(u, (f, b, v) => sr(v));
|
|
4132
|
+
const l = /<a[^>]*href="(https?:\/\/cal\.com\/([a-zA-Z0-9_-]+)(?:\/([a-zA-Z0-9_-]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
4133
|
+
e = e.replace(l, (f, b, v, M) => nr(v, M, r));
|
|
3916
4134
|
const d = new RegExp(`(?<!["'=])(https?:\\/\\/cal\\.com\\/([a-zA-Z0-9_-]+)(?:\\/([a-zA-Z0-9_-]+))?)(?!["'])`, "gi");
|
|
3917
|
-
e = e.replace(d, (f, b,
|
|
4135
|
+
e = e.replace(d, (f, b, v, M) => nr(v, M, r));
|
|
3918
4136
|
const p = /<a[^>]*href="(https?:\/\/(?:www\.)?notion\.so\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3919
|
-
e = e.replace(p, (f, b,
|
|
4137
|
+
e = e.replace(p, (f, b, v) => ir(v));
|
|
3920
4138
|
const w = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?notion\\.so\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
|
|
3921
|
-
e = e.replace(w, (f, b,
|
|
3922
|
-
const
|
|
3923
|
-
e = e.replace(
|
|
4139
|
+
e = e.replace(w, (f, b, v) => ir(v));
|
|
4140
|
+
const c = /<a[^>]*href="(https?:\/\/airtable\.com\/(?:embed\/)?([a-zA-Z0-9]+)(?:\/([a-zA-Z0-9]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
4141
|
+
e = e.replace(c, (f, b, v, M) => or(v, M));
|
|
3924
4142
|
const m = new RegExp(`(?<!["'=])(https?:\\/\\/airtable\\.com\\/(?:embed\\/)?([a-zA-Z0-9]+)(?:\\/([a-zA-Z0-9]+))?)(?!["'])`, "gi");
|
|
3925
|
-
e = e.replace(m, (f, b,
|
|
4143
|
+
e = e.replace(m, (f, b, v, M) => or(v, M));
|
|
3926
4144
|
const h = /<a[^>]*href="(https?:\/\/miro\.com\/app\/board\/([a-zA-Z0-9_=-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3927
|
-
e = e.replace(h, (f, b,
|
|
4145
|
+
e = e.replace(h, (f, b, v) => lr(v));
|
|
3928
4146
|
const g = new RegExp(`(?<!["'=])(https?:\\/\\/miro\\.com\\/app\\/board\\/([a-zA-Z0-9_=-]+))(?!["'])`, "gi");
|
|
3929
|
-
return e = e.replace(g, (f, b,
|
|
4147
|
+
return e = e.replace(g, (f, b, v) => lr(v)), e;
|
|
3930
4148
|
}
|
|
3931
4149
|
function rr(e) {
|
|
3932
4150
|
return `
|
|
@@ -3995,7 +4213,7 @@ function or(e, t) {
|
|
|
3995
4213
|
</div>
|
|
3996
4214
|
`;
|
|
3997
4215
|
}
|
|
3998
|
-
function
|
|
4216
|
+
function lr(e) {
|
|
3999
4217
|
return `
|
|
4000
4218
|
<div class="artifactuse-miro-wrapper">
|
|
4001
4219
|
<iframe
|
|
@@ -4007,37 +4225,37 @@ function cr(e) {
|
|
|
4007
4225
|
</div>
|
|
4008
4226
|
`;
|
|
4009
4227
|
}
|
|
4010
|
-
let K = null,
|
|
4011
|
-
function
|
|
4228
|
+
let K = null, Se = !1, nt = !1;
|
|
4229
|
+
function Cr(e) {
|
|
4012
4230
|
const t = /<pre><code class="language-mermaid">([\s\S]*?)<\/code><\/pre>/gi;
|
|
4013
4231
|
return e = e.replace(t, (r, a) => {
|
|
4014
|
-
const s =
|
|
4015
|
-
return
|
|
4232
|
+
const s = Cs(a).trim();
|
|
4233
|
+
return Rs(s);
|
|
4016
4234
|
}), e;
|
|
4017
4235
|
}
|
|
4018
|
-
function
|
|
4236
|
+
function Cs(e) {
|
|
4019
4237
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, " ");
|
|
4020
4238
|
}
|
|
4021
|
-
function
|
|
4022
|
-
const t =
|
|
4239
|
+
function Rs(e) {
|
|
4240
|
+
const t = Rr(e);
|
|
4023
4241
|
return `
|
|
4024
4242
|
<div class="artifactuse-mermaid-container" data-mermaid-id="${`mermaid-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`}" data-mermaid-diagram="${t}">
|
|
4025
4243
|
<div class="artifactuse-mermaid-loading">Loading diagram...</div>
|
|
4026
4244
|
</div>
|
|
4027
4245
|
`;
|
|
4028
4246
|
}
|
|
4029
|
-
function
|
|
4247
|
+
function Rr(e) {
|
|
4030
4248
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">");
|
|
4031
4249
|
}
|
|
4032
|
-
function
|
|
4250
|
+
function Lr(e) {
|
|
4033
4251
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
4034
4252
|
}
|
|
4035
|
-
function
|
|
4036
|
-
return typeof mermaid > "u" ?
|
|
4037
|
-
console.error("Failed to load Mermaid library:", t),
|
|
4038
|
-
})) : (nt ||
|
|
4253
|
+
function Tr(e = {}) {
|
|
4254
|
+
return typeof mermaid > "u" ? Se ? (console.warn("Mermaid loading previously failed. Diagram rendering disabled."), Promise.resolve()) : (console.debug("Mermaid library not loaded. Attempting to load..."), Ts().then(() => (console.log("Mermaid loaded, rendering diagrams..."), cr(e), Ce())).catch((t) => {
|
|
4255
|
+
console.error("Failed to load Mermaid library:", t), Se = !0, Ls();
|
|
4256
|
+
})) : (nt || cr(e), Ce());
|
|
4039
4257
|
}
|
|
4040
|
-
function
|
|
4258
|
+
function cr(e = {}) {
|
|
4041
4259
|
if (typeof mermaid > "u") return;
|
|
4042
4260
|
const r = {
|
|
4043
4261
|
dark: "dark",
|
|
@@ -4067,7 +4285,7 @@ function lr(e = {}) {
|
|
|
4067
4285
|
};
|
|
4068
4286
|
mermaid.initialize(a), nt = !0;
|
|
4069
4287
|
}
|
|
4070
|
-
async function
|
|
4288
|
+
async function Ce() {
|
|
4071
4289
|
if (typeof mermaid > "u") {
|
|
4072
4290
|
console.warn("renderAllMermaid called but Mermaid is not available");
|
|
4073
4291
|
return;
|
|
@@ -4075,7 +4293,7 @@ async function Le() {
|
|
|
4075
4293
|
const e = document.querySelectorAll(".artifactuse-mermaid-container");
|
|
4076
4294
|
for (const t of e) {
|
|
4077
4295
|
if (t.dataset.rendered === "true") continue;
|
|
4078
|
-
const r =
|
|
4296
|
+
const r = Lr(t.dataset.mermaidDiagram), a = t.dataset.mermaidId;
|
|
4079
4297
|
try {
|
|
4080
4298
|
if (await mermaid.parse(r)) {
|
|
4081
4299
|
const { svg: n } = await mermaid.render(a, r);
|
|
@@ -4095,10 +4313,10 @@ async function Le() {
|
|
|
4095
4313
|
}
|
|
4096
4314
|
}
|
|
4097
4315
|
}
|
|
4098
|
-
function
|
|
4316
|
+
function Ls() {
|
|
4099
4317
|
document.querySelectorAll(".artifactuse-mermaid-container").forEach((e) => {
|
|
4100
4318
|
if (e.dataset.rendered === "true") return;
|
|
4101
|
-
const t =
|
|
4319
|
+
const t = Lr(e.dataset.mermaidDiagram);
|
|
4102
4320
|
e.innerHTML = `
|
|
4103
4321
|
<div class="artifactuse-mermaid-fallback">
|
|
4104
4322
|
<div class="artifactuse-mermaid-fallback-title">Mermaid Diagram</div>
|
|
@@ -4110,7 +4328,7 @@ function Ms() {
|
|
|
4110
4328
|
function Ge(e) {
|
|
4111
4329
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
4112
4330
|
}
|
|
4113
|
-
function
|
|
4331
|
+
function Ts() {
|
|
4114
4332
|
return K || (typeof mermaid < "u" ? Promise.resolve() : (K = new Promise((e, t) => {
|
|
4115
4333
|
const r = setTimeout(() => {
|
|
4116
4334
|
K = null, t(new Error("Mermaid loading timed out after 15 seconds"));
|
|
@@ -4123,28 +4341,28 @@ function _s() {
|
|
|
4123
4341
|
}), K));
|
|
4124
4342
|
}
|
|
4125
4343
|
function rn() {
|
|
4126
|
-
K = null,
|
|
4344
|
+
K = null, Se = !1, nt = !1;
|
|
4127
4345
|
}
|
|
4128
4346
|
function an() {
|
|
4129
4347
|
return typeof mermaid < "u";
|
|
4130
4348
|
}
|
|
4131
4349
|
function sn() {
|
|
4132
|
-
return
|
|
4350
|
+
return Se;
|
|
4133
4351
|
}
|
|
4134
4352
|
function nn(e, t = {}) {
|
|
4135
4353
|
if (!e) return Promise.resolve();
|
|
4136
4354
|
let r = e.innerHTML;
|
|
4137
|
-
return r =
|
|
4355
|
+
return r = Cr(r), e.innerHTML = r, Tr(t);
|
|
4138
4356
|
}
|
|
4139
4357
|
async function on(e) {
|
|
4140
4358
|
const t = document.querySelector(`[data-mermaid-id="${e}"]`);
|
|
4141
|
-
t && (t.dataset.rendered = "false", t.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await
|
|
4359
|
+
t && (t.dataset.rendered = "false", t.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await Ce());
|
|
4142
4360
|
}
|
|
4143
|
-
async function
|
|
4361
|
+
async function ln(e, t) {
|
|
4144
4362
|
const r = document.querySelector(`[data-mermaid-id="${e}"]`);
|
|
4145
|
-
r && (r.dataset.mermaidDiagram =
|
|
4363
|
+
r && (r.dataset.mermaidDiagram = Rr(t), r.dataset.rendered = "false", r.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await Ce());
|
|
4146
4364
|
}
|
|
4147
|
-
function
|
|
4365
|
+
function _s(e) {
|
|
4148
4366
|
const t = /<table([^>]*)>([\s\S]*?)<\/table>/gi;
|
|
4149
4367
|
let r = 0;
|
|
4150
4368
|
return e = e.replace(t, (a, s, n) => {
|
|
@@ -4230,11 +4448,11 @@ function js(e) {
|
|
|
4230
4448
|
}), r.join(`
|
|
4231
4449
|
`);
|
|
4232
4450
|
}
|
|
4233
|
-
function
|
|
4451
|
+
function Hs(e, t = "table-data.csv") {
|
|
4234
4452
|
const r = new Blob([e], { type: "text/csv;charset=utf-8;" }), a = URL.createObjectURL(r), s = document.createElement("a");
|
|
4235
4453
|
s.href = a, s.download = t, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(a);
|
|
4236
4454
|
}
|
|
4237
|
-
function
|
|
4455
|
+
function Vs(e) {
|
|
4238
4456
|
const t = e.querySelectorAll("tr"), r = [];
|
|
4239
4457
|
return t.forEach((a) => {
|
|
4240
4458
|
const s = a.querySelectorAll("th, td"), n = [];
|
|
@@ -4244,20 +4462,20 @@ function Ds(e) {
|
|
|
4244
4462
|
}), r.join(`
|
|
4245
4463
|
`);
|
|
4246
4464
|
}
|
|
4247
|
-
function
|
|
4465
|
+
function Is(e, t, r = !0) {
|
|
4248
4466
|
const a = e.querySelector("tbody") || e, s = Array.from(a.querySelectorAll("tr")).filter((n) => !n.querySelector("th"));
|
|
4249
4467
|
s.sort((n, o) => {
|
|
4250
4468
|
const i = n.cells[t], u = o.cells[t];
|
|
4251
4469
|
if (!i || !u) return 0;
|
|
4252
|
-
let
|
|
4253
|
-
const p = parseFloat(
|
|
4470
|
+
let l = i.textContent.trim(), d = u.textContent.trim();
|
|
4471
|
+
const p = parseFloat(l.replace(/[,$%]/g, "")), w = parseFloat(d.replace(/[,$%]/g, ""));
|
|
4254
4472
|
if (!isNaN(p) && !isNaN(w))
|
|
4255
4473
|
return r ? p - w : w - p;
|
|
4256
|
-
const
|
|
4257
|
-
return !isNaN(
|
|
4474
|
+
const c = new Date(l), m = new Date(d);
|
|
4475
|
+
return !isNaN(c.getTime()) && !isNaN(m.getTime()) ? r ? c - m : m - c : r ? l.localeCompare(d) : d.localeCompare(l);
|
|
4258
4476
|
}), s.forEach((n) => a.appendChild(n));
|
|
4259
4477
|
}
|
|
4260
|
-
function
|
|
4478
|
+
function Ds(e, t) {
|
|
4261
4479
|
const r = e.querySelectorAll("tbody tr, tr:not(:first-child)"), a = t.toLowerCase().trim();
|
|
4262
4480
|
let s = 0;
|
|
4263
4481
|
return r.forEach((n) => {
|
|
@@ -4269,13 +4487,13 @@ function qs(e, t) {
|
|
|
4269
4487
|
n.style.display = i ? "" : "none", i && s++;
|
|
4270
4488
|
}), s;
|
|
4271
4489
|
}
|
|
4272
|
-
function
|
|
4490
|
+
function qs() {
|
|
4273
4491
|
document.querySelectorAll("[data-table-search]").forEach((e) => {
|
|
4274
4492
|
const t = e.dataset.tableSearch, r = document.getElementById(t), a = document.querySelector(`[data-table-count="${t}"]`);
|
|
4275
4493
|
if (r) {
|
|
4276
4494
|
const s = r.querySelectorAll("tbody tr, tr:not(:first-child)"), n = Array.from(s).filter((o) => !o.querySelector("th")).length;
|
|
4277
4495
|
a && (a.textContent = `${n} rows`), e.addEventListener("input", (o) => {
|
|
4278
|
-
const i =
|
|
4496
|
+
const i = Ds(r, o.target.value);
|
|
4279
4497
|
a && (a.textContent = o.target.value ? `${i} of ${n} rows` : `${n} rows`);
|
|
4280
4498
|
});
|
|
4281
4499
|
}
|
|
@@ -4284,21 +4502,21 @@ function Zs() {
|
|
|
4284
4502
|
const t = e.closest("table"), r = parseInt(e.dataset.sortCol), s = e.dataset.sortDir !== "asc";
|
|
4285
4503
|
t.querySelectorAll(".artifactuse-sortable-header").forEach((n) => {
|
|
4286
4504
|
n.dataset.sortDir = "", n.classList.remove("sort-asc", "sort-desc");
|
|
4287
|
-
}), e.dataset.sortDir = s ? "asc" : "desc", e.classList.add(s ? "sort-asc" : "sort-desc"),
|
|
4505
|
+
}), e.dataset.sortDir = s ? "asc" : "desc", e.classList.add(s ? "sort-asc" : "sort-desc"), Is(t, r, s);
|
|
4288
4506
|
});
|
|
4289
4507
|
}), document.querySelectorAll("[data-table-export]").forEach((e) => {
|
|
4290
4508
|
e.addEventListener("click", () => {
|
|
4291
4509
|
const t = e.dataset.tableExport, r = document.getElementById(t);
|
|
4292
4510
|
if (r) {
|
|
4293
4511
|
const a = js(r);
|
|
4294
|
-
|
|
4512
|
+
Hs(a, `${t}.csv`);
|
|
4295
4513
|
}
|
|
4296
4514
|
});
|
|
4297
4515
|
}), document.querySelectorAll("[data-table-copy]").forEach((e) => {
|
|
4298
4516
|
e.addEventListener("click", async () => {
|
|
4299
4517
|
const t = e.dataset.tableCopy, r = document.getElementById(t);
|
|
4300
4518
|
if (r) {
|
|
4301
|
-
const a =
|
|
4519
|
+
const a = Vs(r);
|
|
4302
4520
|
try {
|
|
4303
4521
|
await navigator.clipboard.writeText(a);
|
|
4304
4522
|
const s = e.querySelector("span"), n = s ? s.textContent : "";
|
|
@@ -4312,11 +4530,11 @@ function Zs() {
|
|
|
4312
4530
|
});
|
|
4313
4531
|
});
|
|
4314
4532
|
}
|
|
4315
|
-
let J = null,
|
|
4316
|
-
function
|
|
4317
|
-
return e =
|
|
4533
|
+
let J = null, Re = !1;
|
|
4534
|
+
function _r(e) {
|
|
4535
|
+
return e = Zs(e), e = e.replace(/\$\$([\s\S]*?)\$\$/g, (t, r) => fe(r.trim(), !0)), e = e.replace(/\\\[([\s\S]*?)\\\]/g, (t, r) => fe(r.trim(), !0)), e = e.replace(new RegExp("(?<!\\$)\\$(?!\\$)((?:[^$\\\\]|\\\\.)+?)\\$(?!\\$)", "g"), (t, r) => fe(r.trim(), !1)), e = e.replace(/\\\(([\s\S]*?)\\\)/g, (t, r) => fe(r.trim(), !1)), e;
|
|
4318
4536
|
}
|
|
4319
|
-
function
|
|
4537
|
+
function Zs(e) {
|
|
4320
4538
|
const t = /<pre><code class="language-(math|latex)">([\s\S]*?)<\/code><\/pre>/gi;
|
|
4321
4539
|
return e = e.replace(t, (r, a, s) => {
|
|
4322
4540
|
const n = Os(s).trim();
|
|
@@ -4327,20 +4545,20 @@ function Os(e) {
|
|
|
4327
4545
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, " ");
|
|
4328
4546
|
}
|
|
4329
4547
|
function fe(e, t = !1) {
|
|
4330
|
-
const r =
|
|
4548
|
+
const r = Bs(e);
|
|
4331
4549
|
return `<span class="artifactuse-math-container ${t ? "artifactuse-math-display" : "artifactuse-math-inline"}" data-tex="${r}" data-display="${t ? "true" : "false"}"></span>`;
|
|
4332
4550
|
}
|
|
4333
|
-
function
|
|
4551
|
+
function Bs(e) {
|
|
4334
4552
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">");
|
|
4335
4553
|
}
|
|
4336
4554
|
function Er(e) {
|
|
4337
4555
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
4338
4556
|
}
|
|
4339
4557
|
function Pr() {
|
|
4340
|
-
return typeof katex > "u" ?
|
|
4558
|
+
return typeof katex > "u" ? Re ? (console.warn("KaTeX loading previously failed. Math rendering disabled."), Promise.resolve()) : (console.debug("KaTeX library not loaded. Attempting to load..."), Ns().then(() => {
|
|
4341
4559
|
console.log("KaTeX loaded, rendering math..."), ur();
|
|
4342
4560
|
}).catch((e) => {
|
|
4343
|
-
console.error("Failed to load KaTeX library:", e),
|
|
4561
|
+
console.error("Failed to load KaTeX library:", e), Re = !0, Fs();
|
|
4344
4562
|
})) : (ur(), Promise.resolve());
|
|
4345
4563
|
}
|
|
4346
4564
|
function Fs() {
|
|
@@ -4401,19 +4619,19 @@ function Ns() {
|
|
|
4401
4619
|
}, document.head.appendChild(s);
|
|
4402
4620
|
}), J));
|
|
4403
4621
|
}
|
|
4404
|
-
function
|
|
4405
|
-
J = null,
|
|
4622
|
+
function cn() {
|
|
4623
|
+
J = null, Re = !1;
|
|
4406
4624
|
}
|
|
4407
4625
|
function un() {
|
|
4408
4626
|
return typeof katex < "u";
|
|
4409
4627
|
}
|
|
4410
4628
|
function dn() {
|
|
4411
|
-
return
|
|
4629
|
+
return Re;
|
|
4412
4630
|
}
|
|
4413
4631
|
function pn(e) {
|
|
4414
4632
|
if (!e) return Promise.resolve();
|
|
4415
4633
|
let t = e.innerHTML;
|
|
4416
|
-
return t =
|
|
4634
|
+
return t = _r(t), e.innerHTML = t, Pr();
|
|
4417
4635
|
}
|
|
4418
4636
|
const fn = {
|
|
4419
4637
|
// Fractions
|
|
@@ -4477,7 +4695,7 @@ function Us(e) {
|
|
|
4477
4695
|
for (const s of t) {
|
|
4478
4696
|
const n = s.match(/^(?:language-|lang-)(.+)$/);
|
|
4479
4697
|
if (n)
|
|
4480
|
-
return
|
|
4698
|
+
return He(n[1]);
|
|
4481
4699
|
}
|
|
4482
4700
|
const r = e.closest("pre");
|
|
4483
4701
|
if (r) {
|
|
@@ -4485,13 +4703,13 @@ function Us(e) {
|
|
|
4485
4703
|
for (const n of s) {
|
|
4486
4704
|
const o = n.match(/^(?:language-|lang-)(.+)$/);
|
|
4487
4705
|
if (o)
|
|
4488
|
-
return
|
|
4706
|
+
return He(o[1]);
|
|
4489
4707
|
}
|
|
4490
4708
|
}
|
|
4491
4709
|
const a = e.dataset.language || (r == null ? void 0 : r.dataset.language);
|
|
4492
|
-
return a ?
|
|
4710
|
+
return a ? He(a) : null;
|
|
4493
4711
|
}
|
|
4494
|
-
function
|
|
4712
|
+
function He(e) {
|
|
4495
4713
|
const t = {
|
|
4496
4714
|
js: "javascript",
|
|
4497
4715
|
ts: "typescript",
|
|
@@ -4552,7 +4770,7 @@ function Gs() {
|
|
|
4552
4770
|
const e = {
|
|
4553
4771
|
image(a) {
|
|
4554
4772
|
const s = typeof a == "string" ? a : a.href, n = typeof a == "string" ? arguments[1] : a.title, o = typeof a == "string" ? arguments[2] : a.text;
|
|
4555
|
-
return
|
|
4773
|
+
return qe(s || "", n || "", o || "");
|
|
4556
4774
|
}
|
|
4557
4775
|
}, t = {
|
|
4558
4776
|
link(a) {
|
|
@@ -4568,7 +4786,7 @@ function Gs() {
|
|
|
4568
4786
|
return o ? `<pre><code class="language-${ke(o)}">${i}</code></pre>` : `<pre><code>${i}</code></pre>`;
|
|
4569
4787
|
}
|
|
4570
4788
|
};
|
|
4571
|
-
|
|
4789
|
+
H.use({
|
|
4572
4790
|
renderer: {
|
|
4573
4791
|
...e,
|
|
4574
4792
|
...t,
|
|
@@ -4579,7 +4797,7 @@ function Gs() {
|
|
|
4579
4797
|
});
|
|
4580
4798
|
}
|
|
4581
4799
|
Gs();
|
|
4582
|
-
const
|
|
4800
|
+
const Hr = {
|
|
4583
4801
|
// Structured artifact types
|
|
4584
4802
|
form: "form-panel",
|
|
4585
4803
|
// Visual editors
|
|
@@ -4634,6 +4852,8 @@ const Ir = {
|
|
|
4634
4852
|
// Initial split view position as percentage (20-80)
|
|
4635
4853
|
// Can be overridden per-component via props
|
|
4636
4854
|
splitPosition: 50,
|
|
4855
|
+
// Enable multi-tab mode (open multiple artifacts as tabs)
|
|
4856
|
+
multiTab: !1,
|
|
4637
4857
|
// Panel configuration
|
|
4638
4858
|
// Users can add/override/disable panels here
|
|
4639
4859
|
//
|
|
@@ -4693,7 +4913,7 @@ const Ir = {
|
|
|
4693
4913
|
expiryDays: 30
|
|
4694
4914
|
}
|
|
4695
4915
|
};
|
|
4696
|
-
function
|
|
4916
|
+
function Vr(e, t) {
|
|
4697
4917
|
if (e == null)
|
|
4698
4918
|
return null;
|
|
4699
4919
|
try {
|
|
@@ -4716,25 +4936,25 @@ function Xs(e, t) {
|
|
|
4716
4936
|
console.warn("Artifactuse: Invalid default CDN URL:", t);
|
|
4717
4937
|
}
|
|
4718
4938
|
for (const a of Object.values(e)) {
|
|
4719
|
-
const s =
|
|
4939
|
+
const s = Vr(a, t);
|
|
4720
4940
|
s && r.add(s);
|
|
4721
4941
|
}
|
|
4722
4942
|
return [...r];
|
|
4723
4943
|
}
|
|
4724
4944
|
function Ks(e, t) {
|
|
4725
|
-
const r = { ...
|
|
4945
|
+
const r = { ...Hr };
|
|
4726
4946
|
if (e.panels)
|
|
4727
|
-
for (const [u,
|
|
4947
|
+
for (const [u, l] of Object.entries(e.panels))
|
|
4728
4948
|
if (Array.isArray(u))
|
|
4729
4949
|
u.forEach((d) => {
|
|
4730
4950
|
const p = d == null ? void 0 : d.toLowerCase();
|
|
4731
|
-
p && (r[p] =
|
|
4951
|
+
p && (r[p] = l);
|
|
4732
4952
|
});
|
|
4733
4953
|
else {
|
|
4734
4954
|
const d = u == null ? void 0 : u.toLowerCase();
|
|
4735
|
-
d && (r[d] =
|
|
4955
|
+
d && (r[d] = l);
|
|
4736
4956
|
}
|
|
4737
|
-
function a(u,
|
|
4957
|
+
function a(u, l = {}) {
|
|
4738
4958
|
const d = u == null ? void 0 : u.toLowerCase();
|
|
4739
4959
|
if (!d) return null;
|
|
4740
4960
|
const p = r[d];
|
|
@@ -4747,26 +4967,26 @@ function Ks(e, t) {
|
|
|
4747
4967
|
else
|
|
4748
4968
|
return null;
|
|
4749
4969
|
w.endsWith("/") || (w += "");
|
|
4750
|
-
const
|
|
4751
|
-
|
|
4752
|
-
|
|
4970
|
+
const c = new URLSearchParams();
|
|
4971
|
+
l.theme && c.set("theme", l.theme), l.accent && c.set("accent", l.accent), l.params && Object.entries(l.params).forEach(([h, g]) => {
|
|
4972
|
+
c.set(h, g);
|
|
4753
4973
|
});
|
|
4754
|
-
const m =
|
|
4974
|
+
const m = c.toString();
|
|
4755
4975
|
return m ? `${w}?${m}` : w;
|
|
4756
4976
|
}
|
|
4757
4977
|
function s(u) {
|
|
4758
|
-
const
|
|
4759
|
-
return
|
|
4978
|
+
const l = u == null ? void 0 : u.toLowerCase();
|
|
4979
|
+
return l && r[l] !== void 0 && r[l] !== null;
|
|
4760
4980
|
}
|
|
4761
4981
|
function n() {
|
|
4762
4982
|
return Object.keys(r).filter((u) => r[u] !== null);
|
|
4763
4983
|
}
|
|
4764
|
-
function o(u,
|
|
4984
|
+
function o(u, l) {
|
|
4765
4985
|
(Array.isArray(u) ? u : [u]).forEach((w) => {
|
|
4766
|
-
const
|
|
4767
|
-
|
|
4986
|
+
const c = w == null ? void 0 : w.toLowerCase();
|
|
4987
|
+
c && (r[c] = l);
|
|
4768
4988
|
});
|
|
4769
|
-
const p =
|
|
4989
|
+
const p = Vr(l, e.cdnUrl);
|
|
4770
4990
|
p && t && t.addAllowedOrigin(p);
|
|
4771
4991
|
}
|
|
4772
4992
|
function i(u) {
|
|
@@ -4788,137 +5008,137 @@ function Ks(e, t) {
|
|
|
4788
5008
|
};
|
|
4789
5009
|
}
|
|
4790
5010
|
function bn(e = {}) {
|
|
4791
|
-
const t =
|
|
4792
|
-
function d(k,
|
|
4793
|
-
let
|
|
4794
|
-
const D = [],
|
|
5011
|
+
const t = Ir(Ws, e), r = ta(), a = { ...Hr, ...t.panels }, s = Xs(a, t.cdnUrl), n = ra(s), o = na(t.theme, t.colors || {}), i = Ks(t, n), u = pa(t.sharing), l = fa(t.editor);
|
|
5012
|
+
function d(k, _, R = {}) {
|
|
5013
|
+
let A = H.parse(k);
|
|
5014
|
+
const D = [], P = { theme: o.resolved }, Z = R.inlinePreview ?? t.inlinePreview ?? null, ne = R.inlineCode ?? t.inlineCode ?? null, re = R.tabs ?? t.tabs ?? null, ae = R.viewMode ?? t.viewMode ?? null;
|
|
4795
5015
|
if (t.processors.codeBlocks) {
|
|
4796
|
-
const O = ea(
|
|
5016
|
+
const O = ea(A, _, {
|
|
4797
5017
|
...t.codeExtraction,
|
|
4798
|
-
inlinePreview:
|
|
5018
|
+
inlinePreview: Z,
|
|
4799
5019
|
inlineCode: ne,
|
|
4800
5020
|
tabs: re,
|
|
4801
5021
|
viewMode: ae
|
|
4802
5022
|
});
|
|
4803
|
-
|
|
5023
|
+
A = O.html, D.push(...O.artifacts);
|
|
4804
5024
|
}
|
|
4805
|
-
return t.processors.images && (
|
|
5025
|
+
return t.processors.images && (A = Qa(A)), t.processors.imageGalleries && (A = Ya(A)), t.processors.videos && (A = as(A)), t.processors.videoGalleries && (A = os(A)), t.processors.audio && (A = us(A, P)), t.processors.maps && (A = bs(A)), t.processors.social && (A = vs(A, P)), t.processors.documents && (A = ys(A), A = ks(A), A = xs(A)), t.processors.codeEmbeds && (A = $s(A, P)), t.processors.dataViz && (A = zs(A)), t.processors.design && (A = As(A, P)), t.processors.interactive && (A = Ss(A, P)), t.processors.tables && (A = _s(A)), t.processors.math && (A = _r(A)), t.processors.mermaid && (A = Cr(A)), D.forEach((O) => {
|
|
4806
5026
|
r.addArtifact(O);
|
|
4807
5027
|
}), {
|
|
4808
|
-
html:
|
|
5028
|
+
html: A,
|
|
4809
5029
|
artifacts: D
|
|
4810
5030
|
};
|
|
4811
5031
|
}
|
|
4812
5032
|
async function p(k = document) {
|
|
4813
|
-
const
|
|
4814
|
-
t.processors.math &&
|
|
5033
|
+
const _ = [], R = { theme: o.resolved };
|
|
5034
|
+
t.processors.math && _.push(Pr()), t.processors.mermaid && _.push(Tr(R)), t.processors.tables && qs(), t.processors.audio && ps(k), t.syntaxHighlight && (jr(k), (k === document ? document : k).querySelectorAll(".artifactuse-inline-preview[data-smartdiff]").forEach((P) => {
|
|
4815
5035
|
var ae;
|
|
4816
|
-
const
|
|
4817
|
-
if (!
|
|
4818
|
-
const ne = ((ae =
|
|
5036
|
+
const Z = P.querySelector("code");
|
|
5037
|
+
if (!Z || Z.dataset.smartdiffProcessed) return;
|
|
5038
|
+
const ne = ((ae = P.dataset.smartdiffMarkers) == null ? void 0 : ae.split(",")) || [], re = Z.innerHTML.split(`
|
|
4819
5039
|
`);
|
|
4820
|
-
|
|
5040
|
+
Z.innerHTML = re.map((O, be) => {
|
|
4821
5041
|
const ie = ne[be];
|
|
4822
5042
|
return ie === "-" ? `<span class="token deleted">${O}</span>` : ie === "+" ? `<span class="token inserted">${O}</span>` : O;
|
|
4823
5043
|
}).join(`
|
|
4824
|
-
`),
|
|
4825
|
-
})), await Promise.all(
|
|
5044
|
+
`), Z.dataset.smartdiffProcessed = "true";
|
|
5045
|
+
})), await Promise.all(_);
|
|
4826
5046
|
}
|
|
4827
5047
|
function w(k) {
|
|
4828
5048
|
if (k.isInline) {
|
|
4829
5049
|
console.warn("Attempted to open inline artifact in panel:", k.id);
|
|
4830
5050
|
return;
|
|
4831
5051
|
}
|
|
4832
|
-
r.setActiveArtifact(k.id), r.setPanelOpen(!0), k.viewMode && r.setViewMode(k.viewMode),
|
|
5052
|
+
t.multiTab ? r.openTab(k.id) : r.setActiveArtifact(k.id), r.setPanelOpen(!0), k.viewMode && r.setViewMode(k.viewMode), L("artifact:opened", k);
|
|
4833
5053
|
}
|
|
4834
|
-
function
|
|
4835
|
-
const
|
|
4836
|
-
return m(
|
|
5054
|
+
function c(k, _, R = {}) {
|
|
5055
|
+
const A = k.split(".").pop(), D = R.language || Nr(A) || A, P = R.title || k;
|
|
5056
|
+
return m(_, D, { ...R, title: P });
|
|
4837
5057
|
}
|
|
4838
|
-
function m(k,
|
|
4839
|
-
const
|
|
4840
|
-
return
|
|
5058
|
+
function m(k, _, R = {}) {
|
|
5059
|
+
const A = R.messageId || Br("open"), D = $({ type: _, language: _ }) ? _ : "txt", P = Me(k, D, A, 0);
|
|
5060
|
+
return P.title = R.title || P.title, P.isInline = !1, P.editorLanguage = _, R.tabs && (P.tabs = R.tabs), R.panelUrl && (P.panelUrl = R.panelUrl), r.addArtifact(P), w(P), R.viewMode ? r.setViewMode(R.viewMode) : R.tabs && r.setViewMode(R.tabs[0]), P;
|
|
4841
5061
|
}
|
|
4842
|
-
function h(k,
|
|
4843
|
-
const
|
|
5062
|
+
function h(k, _, R = {}) {
|
|
5063
|
+
const A = typeof k == "string" ? k : k == null ? void 0 : k.id, D = r.getArtifact(A);
|
|
4844
5064
|
if (!D) return null;
|
|
4845
|
-
const
|
|
4846
|
-
return
|
|
5065
|
+
const P = { ...D, code: _, _refreshToken: Date.now() };
|
|
5066
|
+
return R.title !== void 0 && (P.title = R.title), R.tabs !== void 0 && (P.tabs = R.tabs), R.panelUrl !== void 0 && (P.panelUrl = R.panelUrl), r.addArtifact(P), L("artifact:updated", { artifactId: A, artifact: r.getArtifact(A) }), r.getArtifact(A);
|
|
4847
5067
|
}
|
|
4848
5068
|
function g() {
|
|
4849
|
-
r.setPanelOpen(!1), r.setFullscreen(!1),
|
|
5069
|
+
r.setPanelOpen(!1), r.setFullscreen(!1), L("panel:closed");
|
|
4850
5070
|
}
|
|
4851
5071
|
function f() {
|
|
4852
5072
|
const k = !r.getState().isPanelOpen;
|
|
4853
|
-
r.clearActiveArtifact(), r.setPanelOpen(k), k || r.setFullscreen(!1),
|
|
5073
|
+
r.clearActiveArtifact(), r.setPanelOpen(k), k || r.setFullscreen(!1), L("panel:toggled", { isOpen: k });
|
|
4854
5074
|
}
|
|
4855
5075
|
function b() {
|
|
4856
5076
|
const k = !r.getState().isFullscreen;
|
|
4857
|
-
r.setFullscreen(k),
|
|
5077
|
+
r.setFullscreen(k), L("fullscreen:toggled", { isFullscreen: k });
|
|
4858
5078
|
}
|
|
4859
|
-
function
|
|
4860
|
-
r.setViewMode(k),
|
|
5079
|
+
function v(k) {
|
|
5080
|
+
r.setViewMode(k), L("viewMode:changed", { mode: k });
|
|
4861
5081
|
}
|
|
4862
|
-
function
|
|
5082
|
+
function M(k, _ = {}) {
|
|
4863
5083
|
if (!k) return null;
|
|
4864
5084
|
if (k.panelUrl) return k.panelUrl;
|
|
4865
|
-
const { type:
|
|
4866
|
-
theme:
|
|
4867
|
-
},
|
|
4868
|
-
|
|
4869
|
-
let
|
|
4870
|
-
return !
|
|
4871
|
-
}
|
|
4872
|
-
function
|
|
5085
|
+
const { type: R, language: A } = k, D = {
|
|
5086
|
+
theme: _.theme || o.resolved
|
|
5087
|
+
}, P = o.colors;
|
|
5088
|
+
P != null && P.primary && (D.accent = P.primary);
|
|
5089
|
+
let Z = i.resolve(R, D);
|
|
5090
|
+
return !Z && A && (Z = i.resolve(A, D)), Z;
|
|
5091
|
+
}
|
|
5092
|
+
function $(k) {
|
|
4873
5093
|
return k ? i.has(k.type) || i.has(k.language) : !1;
|
|
4874
5094
|
}
|
|
4875
|
-
function
|
|
4876
|
-
i.register(k,
|
|
5095
|
+
function z(k, _) {
|
|
5096
|
+
i.register(k, _);
|
|
4877
5097
|
}
|
|
4878
|
-
function
|
|
5098
|
+
function S(k) {
|
|
4879
5099
|
i.unregister(k);
|
|
4880
5100
|
}
|
|
4881
|
-
function
|
|
5101
|
+
function y() {
|
|
4882
5102
|
return i.getTypes();
|
|
4883
5103
|
}
|
|
4884
|
-
function
|
|
4885
|
-
n.send(k,
|
|
5104
|
+
function C(k, _) {
|
|
5105
|
+
n.send(k, _);
|
|
4886
5106
|
}
|
|
4887
|
-
const
|
|
4888
|
-
function
|
|
4889
|
-
return
|
|
4890
|
-
var
|
|
4891
|
-
(
|
|
5107
|
+
const x = /* @__PURE__ */ new Map();
|
|
5108
|
+
function E(k, _) {
|
|
5109
|
+
return x.has(k) || x.set(k, /* @__PURE__ */ new Set()), x.get(k).add(_), () => {
|
|
5110
|
+
var R;
|
|
5111
|
+
(R = x.get(k)) == null || R.delete(_);
|
|
4892
5112
|
};
|
|
4893
5113
|
}
|
|
4894
|
-
function
|
|
4895
|
-
var
|
|
4896
|
-
(
|
|
5114
|
+
function T(k, _) {
|
|
5115
|
+
var R;
|
|
5116
|
+
(R = x.get(k)) == null || R.delete(_);
|
|
4897
5117
|
}
|
|
4898
|
-
function
|
|
4899
|
-
var
|
|
4900
|
-
(
|
|
5118
|
+
function L(k, _) {
|
|
5119
|
+
var R;
|
|
5120
|
+
(R = x.get(k)) == null || R.forEach((A) => {
|
|
4901
5121
|
try {
|
|
4902
|
-
|
|
5122
|
+
A(_);
|
|
4903
5123
|
} catch (D) {
|
|
4904
5124
|
console.error(`Artifactuse event handler error (${k}):`, D);
|
|
4905
5125
|
}
|
|
4906
5126
|
});
|
|
4907
5127
|
}
|
|
4908
|
-
n.on("ai:request", (k) =>
|
|
4909
|
-
k != null && k.artifactId && (k == null ? void 0 : k.code) !== void 0 && h(k.artifactId, k.code),
|
|
5128
|
+
n.on("ai:request", (k) => L("ai:request", k)), n.on("save:request", (k) => L("save:request", k)), n.on("export:complete", (k) => L("export:complete", k)), n.on("form:submit", (k) => L("form:submit", k)), n.on("form:cancel", (k) => L("form:cancel", k)), n.on("form:step", (k) => L("form:step", k)), n.on("social:copy", (k) => L("social:copy", k)), n.on("edit:save", (k) => {
|
|
5129
|
+
k != null && k.artifactId && (k == null ? void 0 : k.code) !== void 0 && h(k.artifactId, k.code), L("edit:save", k);
|
|
4910
5130
|
});
|
|
4911
|
-
function
|
|
5131
|
+
function I() {
|
|
4912
5132
|
o.apply();
|
|
4913
5133
|
}
|
|
4914
|
-
function
|
|
5134
|
+
function G(k) {
|
|
4915
5135
|
o.set(k);
|
|
4916
5136
|
}
|
|
4917
5137
|
function te() {
|
|
4918
5138
|
return o.resolved;
|
|
4919
5139
|
}
|
|
4920
5140
|
function U() {
|
|
4921
|
-
n.destroy(),
|
|
5141
|
+
n.destroy(), x.clear(), r.clear(), ws();
|
|
4922
5142
|
}
|
|
4923
5143
|
return {
|
|
4924
5144
|
// Config
|
|
@@ -4932,33 +5152,37 @@ function bn(e = {}) {
|
|
|
4932
5152
|
initializeContent: p,
|
|
4933
5153
|
// Panel control
|
|
4934
5154
|
openArtifact: w,
|
|
4935
|
-
openFile:
|
|
5155
|
+
openFile: c,
|
|
4936
5156
|
openCode: m,
|
|
4937
5157
|
updateFile: h,
|
|
4938
5158
|
closePanel: g,
|
|
4939
5159
|
togglePanel: f,
|
|
4940
5160
|
toggleFullscreen: b,
|
|
4941
|
-
setViewMode:
|
|
4942
|
-
getPanelUrl:
|
|
4943
|
-
sendToPanel:
|
|
5161
|
+
setViewMode: v,
|
|
5162
|
+
getPanelUrl: M,
|
|
5163
|
+
sendToPanel: C,
|
|
5164
|
+
// Multi-tab
|
|
5165
|
+
closeTab: (k) => r.closeTab(k),
|
|
5166
|
+
closeOtherTabs: (k) => r.closeOtherTabs(k),
|
|
5167
|
+
closeAllTabs: () => r.closeAllTabs(),
|
|
4944
5168
|
// Panel management (new)
|
|
4945
|
-
hasPanel:
|
|
4946
|
-
registerPanel:
|
|
4947
|
-
unregisterPanel:
|
|
4948
|
-
getPanelTypes:
|
|
5169
|
+
hasPanel: $,
|
|
5170
|
+
registerPanel: z,
|
|
5171
|
+
unregisterPanel: S,
|
|
5172
|
+
getPanelTypes: y,
|
|
4949
5173
|
panelResolver: i,
|
|
4950
5174
|
// Expose for advanced use
|
|
4951
5175
|
// Theme
|
|
4952
5176
|
theme: o,
|
|
4953
|
-
applyTheme:
|
|
4954
|
-
setTheme:
|
|
5177
|
+
applyTheme: I,
|
|
5178
|
+
setTheme: G,
|
|
4955
5179
|
getTheme: te,
|
|
4956
5180
|
// Events
|
|
4957
|
-
on:
|
|
4958
|
-
off:
|
|
4959
|
-
emit:
|
|
5181
|
+
on: E,
|
|
5182
|
+
off: T,
|
|
5183
|
+
emit: L,
|
|
4960
5184
|
// Editor (CodeMirror integration)
|
|
4961
|
-
editor:
|
|
5185
|
+
editor: l,
|
|
4962
5186
|
// Bridge (for advanced use)
|
|
4963
5187
|
bridge: n,
|
|
4964
5188
|
// Sharing
|
|
@@ -4967,7 +5191,7 @@ function bn(e = {}) {
|
|
|
4967
5191
|
destroy: U
|
|
4968
5192
|
};
|
|
4969
5193
|
}
|
|
4970
|
-
function
|
|
5194
|
+
function Ir(e, t, r = /* @__PURE__ */ new WeakSet()) {
|
|
4971
5195
|
if (!t) return e;
|
|
4972
5196
|
if (!e) return t;
|
|
4973
5197
|
if (typeof t == "object" && t !== null) {
|
|
@@ -4988,7 +5212,7 @@ function Hr(e, t, r = /* @__PURE__ */ new WeakSet()) {
|
|
|
4988
5212
|
continue;
|
|
4989
5213
|
}
|
|
4990
5214
|
if (typeof n == "object" && n.constructor === Object) {
|
|
4991
|
-
a[s] =
|
|
5215
|
+
a[s] = Ir(e[s] || {}, n, r);
|
|
4992
5216
|
continue;
|
|
4993
5217
|
}
|
|
4994
5218
|
a[s] = n;
|
|
@@ -4999,62 +5223,62 @@ function Hr(e, t, r = /* @__PURE__ */ new WeakSet()) {
|
|
|
4999
5223
|
export {
|
|
5000
5224
|
ks as $,
|
|
5001
5225
|
Oe as A,
|
|
5002
|
-
|
|
5226
|
+
Be as B,
|
|
5003
5227
|
Fe as C,
|
|
5004
|
-
|
|
5228
|
+
Hr as D,
|
|
5005
5229
|
Ne as E,
|
|
5006
5230
|
us as F,
|
|
5007
5231
|
vt as G,
|
|
5008
5232
|
yt as H,
|
|
5009
|
-
|
|
5233
|
+
B as I,
|
|
5010
5234
|
kt as J,
|
|
5011
5235
|
ps as K,
|
|
5012
5236
|
ws as L,
|
|
5013
5237
|
bs as M,
|
|
5014
|
-
|
|
5238
|
+
X as N,
|
|
5015
5239
|
Ue as O,
|
|
5016
|
-
|
|
5240
|
+
Ct as P,
|
|
5017
5241
|
vs as Q,
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5242
|
+
Rt as R,
|
|
5243
|
+
Lt as S,
|
|
5244
|
+
Tt as T,
|
|
5245
|
+
_t as U,
|
|
5022
5246
|
Et as V,
|
|
5023
5247
|
Pt as W,
|
|
5024
5248
|
jt as X,
|
|
5025
|
-
|
|
5249
|
+
Ht as Y,
|
|
5026
5250
|
ys as Z,
|
|
5027
|
-
|
|
5251
|
+
Vt as _,
|
|
5028
5252
|
Ys as a,
|
|
5029
5253
|
wn as a$,
|
|
5030
5254
|
se as a0,
|
|
5031
|
-
|
|
5255
|
+
It as a1,
|
|
5032
5256
|
xs as a2,
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5257
|
+
Dt as a3,
|
|
5258
|
+
$s as a4,
|
|
5259
|
+
qt as a5,
|
|
5260
|
+
Zt as a6,
|
|
5037
5261
|
Ot as a7,
|
|
5038
|
-
|
|
5262
|
+
Bt as a8,
|
|
5039
5263
|
Ft as a9,
|
|
5040
5264
|
an as aA,
|
|
5041
5265
|
sn as aB,
|
|
5042
5266
|
nn as aC,
|
|
5043
5267
|
on as aD,
|
|
5044
|
-
|
|
5045
|
-
|
|
5268
|
+
ln as aE,
|
|
5269
|
+
_s as aF,
|
|
5046
5270
|
Es as aG,
|
|
5047
5271
|
js as aH,
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5272
|
+
Hs as aI,
|
|
5273
|
+
Vs as aJ,
|
|
5274
|
+
Is as aK,
|
|
5275
|
+
Ds as aL,
|
|
5276
|
+
qs as aM,
|
|
5277
|
+
_r as aN,
|
|
5054
5278
|
fe as aO,
|
|
5055
5279
|
Pr as aP,
|
|
5056
5280
|
Ns as aQ,
|
|
5057
|
-
|
|
5281
|
+
cn as aR,
|
|
5058
5282
|
un as aS,
|
|
5059
5283
|
dn as aT,
|
|
5060
5284
|
pn as aU,
|
|
@@ -5065,30 +5289,30 @@ export {
|
|
|
5065
5289
|
Us as aZ,
|
|
5066
5290
|
mn as a_,
|
|
5067
5291
|
Nt as aa,
|
|
5068
|
-
|
|
5292
|
+
zs as ab,
|
|
5069
5293
|
Ut as ac,
|
|
5070
5294
|
Gt as ad,
|
|
5071
5295
|
Wt as ae,
|
|
5072
5296
|
Xt as af,
|
|
5073
|
-
|
|
5297
|
+
As as ag,
|
|
5074
5298
|
Kt as ah,
|
|
5075
5299
|
Jt as ai,
|
|
5076
5300
|
Qt as aj,
|
|
5077
5301
|
Yt as ak,
|
|
5078
5302
|
er as al,
|
|
5079
5303
|
tr as am,
|
|
5080
|
-
|
|
5304
|
+
Ss as an,
|
|
5081
5305
|
rr as ao,
|
|
5082
5306
|
ar as ap,
|
|
5083
5307
|
sr as aq,
|
|
5084
5308
|
nr as ar,
|
|
5085
5309
|
ir as as,
|
|
5086
5310
|
or as at,
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5311
|
+
lr as au,
|
|
5312
|
+
Cr as av,
|
|
5313
|
+
Rs as aw,
|
|
5314
|
+
Tr as ax,
|
|
5315
|
+
Ts as ay,
|
|
5092
5316
|
rn as az,
|
|
5093
5317
|
Qs as b,
|
|
5094
5318
|
Wr as c,
|
|
@@ -5102,17 +5326,17 @@ export {
|
|
|
5102
5326
|
ra as k,
|
|
5103
5327
|
na as l,
|
|
5104
5328
|
fa as m,
|
|
5105
|
-
|
|
5329
|
+
He as n,
|
|
5106
5330
|
Qa as o,
|
|
5107
5331
|
tn as p,
|
|
5108
5332
|
Ya as q,
|
|
5109
|
-
|
|
5333
|
+
qe as r,
|
|
5110
5334
|
bt as s,
|
|
5111
5335
|
as as t,
|
|
5112
5336
|
es as u,
|
|
5113
5337
|
rs as v,
|
|
5114
|
-
|
|
5338
|
+
Ze as w,
|
|
5115
5339
|
os as x,
|
|
5116
|
-
|
|
5340
|
+
ls as y,
|
|
5117
5341
|
ns as z
|
|
5118
5342
|
};
|