artifactuse 0.1.28 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -3
- package/dist/{index-D56xsAnF.js → index-BH35XKmt.js} +387 -375
- package/dist/index.js +1 -1
- package/dist/react/index.js +44 -43
- package/dist/styles/components/inline-preview.css +9 -0
- package/dist/svelte/index.js +72 -71
- package/dist/vue/index.js +84 -83
- package/dist/vue2/index.js +46 -6
- package/package.json +1 -1
package/dist/svelte/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { writable as na, derived as Ra } from "svelte/store";
|
|
2
2
|
import { createEventDispatcher as la, onMount as ca, onDestroy as $a, tick as Jt, setContext as Vr, getContext as Ur } from "svelte";
|
|
3
|
-
import { g as Xt, f as nr, a as Va, b as lr, n as xr, i as wr, c as Or, D as Nr, d as jr } from "../index-
|
|
3
|
+
import { g as Xt, f as nr, a as Va, b as lr, n as xr, i as wr, c as Or, D as Nr, d as jr } from "../index-BH35XKmt.js";
|
|
4
4
|
import "svelte/internal/disclose-version";
|
|
5
5
|
import "svelte/internal/flags/legacy";
|
|
6
6
|
import * as e from "svelte/internal/client";
|
|
@@ -9,7 +9,7 @@ import { J as Xr } from "../jszip.min-CdmYyw5L.js";
|
|
|
9
9
|
var Wr = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>'), Zr = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"></polyline></svg>'), Kr = e.from_html('<div role="button" tabindex="0"><div class="artifactuse-card__icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><!></svg></div> <div class="artifactuse-card__content"><div class="artifactuse-card__title"> </div> <div class="artifactuse-card__meta"><span class="artifactuse-card__type"> </span> <span class="artifactuse-card__separator">•</span> <span class="artifactuse-card__size"> </span></div></div> <div class="artifactuse-card__actions"><button class="artifactuse-card__action"><!></button> <button class="artifactuse-card__action" title="Download file"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg></button></div> <div class="artifactuse-card__arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"></polyline></svg></div></div>');
|
|
10
10
|
function Yr(Me, v) {
|
|
11
11
|
e.push(v, !1);
|
|
12
|
-
const fe = e.mutable_source(),
|
|
12
|
+
const fe = e.mutable_source(), F = e.mutable_source(), k = e.mutable_source();
|
|
13
13
|
let i = e.prop(v, "artifact", 8), s = e.prop(v, "isActive", 8, !1);
|
|
14
14
|
const d = la();
|
|
15
15
|
let L = e.mutable_source(!1);
|
|
@@ -51,7 +51,7 @@ function Yr(Me, v) {
|
|
|
51
51
|
e.set(fe, Xt(i().language));
|
|
52
52
|
}), e.legacy_pre_effect(() => e.deep_read_state(i()), () => {
|
|
53
53
|
var q;
|
|
54
|
-
e.set(
|
|
54
|
+
e.set(F, nr(i().size || ((q = i().code) == null ? void 0 : q.length) || 0));
|
|
55
55
|
}), e.legacy_pre_effect(() => e.deep_read_state(i()), () => {
|
|
56
56
|
e.set(k, Va(i().language));
|
|
57
57
|
}), e.legacy_pre_effect_reset(), e.init();
|
|
@@ -81,13 +81,13 @@ function Yr(Me, v) {
|
|
|
81
81
|
e.reset(xe);
|
|
82
82
|
var Ae = e.sibling(xe, 2);
|
|
83
83
|
e.reset(Ie), e.next(2), e.reset(O), e.template_effect(() => {
|
|
84
|
-
re = e.set_class(O, 1, "artifactuse-card", null, re, { "artifactuse-card--active": s() }), e.set_text(E, (e.deep_read_state(i()), e.untrack(() => i().title))), e.set_text(me, e.get(fe)), e.set_text(Ke, e.get(
|
|
84
|
+
re = e.set_class(O, 1, "artifactuse-card", null, re, { "artifactuse-card--active": s() }), e.set_text(E, (e.deep_read_state(i()), e.untrack(() => i().title))), e.set_text(me, e.get(fe)), e.set_text(Ke, e.get(F)), e.set_attribute(xe, "title", e.get(L) ? "Copied!" : "Copy code");
|
|
85
85
|
}), e.event("click", xe, Se), e.event("click", Ae, ye), e.event("click", O, a), e.event("keypress", O, (q) => q.key === "Enter" && a(q)), e.append(Me, O), e.pop();
|
|
86
86
|
}
|
|
87
87
|
var Qr = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>'), Gr = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>'), es = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"></line></svg>'), ts = e.from_html('<div class="artifactuse-form-collapsed"><div class="artifactuse-form-collapsed-icon"><!></div> <span class="artifactuse-form-collapsed-title"> </span></div>'), as = e.from_html('<div class="artifactuse-form-title"> </div>'), rs = e.from_html('<p class="artifactuse-form-description"> </p>'), ss = e.from_html('<div class="artifactuse-form-header"><!> <!></div>'), is = e.from_html('<span class="artifactuse-form-btn-icon"><!></span>'), ns = e.from_html('<button type="button"><!> </button>'), ls = e.from_html('<div class="artifactuse-form-buttons"></div>'), cs = e.from_html('<span class="artifactuse-form-btn-spinner"></span>'), os = e.from_html('<span class="artifactuse-form-btn-icon"><!></span>'), us = e.from_html("<button><!> </button>"), vs = e.from_html('<div class="artifactuse-form-buttons"></div>'), ds = e.from_html('<div class="artifactuse-form-divider"></div>'), ps = e.from_html('<div class="artifactuse-form-heading"> </div>'), _s = e.from_html('<span class="artifactuse-required">*</span>'), fs = e.from_html('<span class="artifactuse-help-text"> </span>'), gs = e.from_html('<span class="artifactuse-error-text"> </span>'), ms = e.from_html('<div class="artifactuse-form-field"><label class="artifactuse-checkbox-label"><input type="checkbox" class="artifactuse-checkbox"/> <span class="artifactuse-checkbox-text"> <!></span></label> <!> <!></div>'), hs = e.from_html('<span class="artifactuse-required">*</span>'), bs = e.from_html('<label class="artifactuse-label"> <!></label>'), ks = e.from_html('<label class="artifactuse-radio-label"><input type="radio" class="artifactuse-radio"/> <span> </span></label>'), ys = e.from_html('<span class="artifactuse-help-text"> </span>'), xs = e.from_html('<span class="artifactuse-error-text"> </span>'), ws = e.from_html('<div class="artifactuse-form-field"><!> <div class="artifactuse-radio-group"></div> <!> <!></div>'), Cs = e.from_html('<span class="artifactuse-required">*</span>'), $s = e.from_html('<input class="artifactuse-input"/>'), As = e.from_html('<textarea class="artifactuse-textarea"></textarea>'), Ls = e.from_html("<option> </option>"), Ps = e.from_html('<select class="artifactuse-select"><option> </option><!></select>'), Ss = e.from_html('<span class="artifactuse-help-text"> </span>'), Es = e.from_html('<span class="artifactuse-error-text"> </span>'), Ts = e.from_html('<div class="artifactuse-form-field"><label class="artifactuse-label"> <!></label> <!> <!> <!></div>'), Bs = e.from_html('<span class="artifactuse-form-btn-spinner"></span>'), Hs = e.from_html('<div class="artifactuse-form-buttons artifactuse-form-buttons-default"><button type="button" class="artifactuse-form-btn artifactuse-form-btn-ghost">Cancel</button> <button type="submit" class="artifactuse-form-btn artifactuse-form-btn-primary"><!> </button></div>'), Ms = e.from_html('<form class="artifactuse-form"><div class="artifactuse-form-fields"></div> <!></form>'), Is = e.from_html("<!> <!>", 1), zs = e.from_html("<div><!></div>");
|
|
88
88
|
function Fs(Me, v) {
|
|
89
89
|
e.push(v, !1);
|
|
90
|
-
const fe = e.mutable_source(),
|
|
90
|
+
const fe = e.mutable_source(), F = e.mutable_source(), k = e.mutable_source(), i = e.mutable_source(), s = e.mutable_source(), d = e.mutable_source(), L = e.mutable_source(), a = e.mutable_source(), Se = e.mutable_source();
|
|
91
91
|
let ye = e.prop(v, "artifact", 8), O = e.prop(v, "theme", 8, "dark"), re = e.prop(v, "accent", 8, null), Te = e.prop(
|
|
92
92
|
v,
|
|
93
93
|
"initialState",
|
|
@@ -115,15 +115,15 @@ function Fs(Me, v) {
|
|
|
115
115
|
if (!o) return null;
|
|
116
116
|
const N = o.trim();
|
|
117
117
|
if (N.startsWith("#")) {
|
|
118
|
-
let
|
|
119
|
-
if (
|
|
120
|
-
const m = parseInt(
|
|
118
|
+
let z = N.slice(1);
|
|
119
|
+
if (z.length === 3 && (z = z.split("").map((m) => m + m).join("")), z.length === 6) {
|
|
120
|
+
const m = parseInt(z.slice(0, 2), 16), ee = parseInt(z.slice(2, 4), 16), ue = parseInt(z.slice(4, 6), 16);
|
|
121
121
|
if (!isNaN(m) && !isNaN(ee) && !isNaN(ue)) return `${m}, ${ee}, ${ue}`;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
const f = N.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
|
|
125
125
|
if (f) return `${f[1]}, ${f[2]}, ${f[3]}`;
|
|
126
|
-
const A = N.split(/[\s,]+/).map(Number).filter((
|
|
126
|
+
const A = N.split(/[\s,]+/).map(Number).filter((z) => !isNaN(z));
|
|
127
127
|
return A.length >= 3 ? `${A[0]}, ${A[1]}, ${A[2]}` : null;
|
|
128
128
|
}
|
|
129
129
|
function Ke(o) {
|
|
@@ -166,33 +166,33 @@ function Fs(Me, v) {
|
|
|
166
166
|
const o = {};
|
|
167
167
|
e.get(d).forEach((A) => {
|
|
168
168
|
if (["buttons", "divider", "heading"].includes(A.type)) return;
|
|
169
|
-
const
|
|
170
|
-
if (A.required && !
|
|
169
|
+
const z = e.get(y)[A.name];
|
|
170
|
+
if (A.required && !z && z !== 0 && z !== !1) {
|
|
171
171
|
o[A.name] = `${A.label || "This field"} is required`;
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
|
-
if (A.pattern &&
|
|
174
|
+
if (A.pattern && z && !new RegExp(A.pattern).test(z)) {
|
|
175
175
|
o[A.name] = A.patternMessage || `${A.label || "This field"} is invalid`;
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
|
-
if (A.type === "email" &&
|
|
178
|
+
if (A.type === "email" && z && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(z)) {
|
|
179
179
|
o[A.name] = "Please enter a valid email address";
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
if (A.minLength &&
|
|
182
|
+
if (A.minLength && z && z.length < A.minLength) {
|
|
183
183
|
o[A.name] = `Minimum ${A.minLength} characters required`;
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
|
-
if (A.maxLength &&
|
|
186
|
+
if (A.maxLength && z && z.length > A.maxLength) {
|
|
187
187
|
o[A.name] = `Maximum ${A.maxLength} characters allowed`;
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
const N = (f = e.get(k).data) == null ? void 0 : f.validation;
|
|
192
|
-
return N && Object.entries(N).forEach(([A,
|
|
192
|
+
return N && Object.entries(N).forEach(([A, z]) => {
|
|
193
193
|
if (o[A]) return;
|
|
194
194
|
const m = e.get(y)[A];
|
|
195
|
-
|
|
195
|
+
z.pattern && m && (new RegExp(z.pattern).test(m) || (o[A] = z.message || `${A} is invalid`));
|
|
196
196
|
}), e.set(_, o), Object.keys(o).length === 0;
|
|
197
197
|
}
|
|
198
198
|
function Ae() {
|
|
@@ -263,7 +263,7 @@ function Fs(Me, v) {
|
|
|
263
263
|
}), e.legacy_pre_effect(() => e.get(I), () => {
|
|
264
264
|
e.set(fe, e.get(I) !== "active");
|
|
265
265
|
}), e.legacy_pre_effect(() => e.get(I), () => {
|
|
266
|
-
e.set(
|
|
266
|
+
e.set(F, e.get(I) === "active" ? "" : `artifactuse-form--${e.get(I)}`);
|
|
267
267
|
}), e.legacy_pre_effect(() => e.deep_read_state(ye()), () => {
|
|
268
268
|
var o;
|
|
269
269
|
e.set(k, Pe((o = ye()) == null ? void 0 : o.code));
|
|
@@ -292,7 +292,7 @@ function Fs(Me, v) {
|
|
|
292
292
|
var nt = (o) => {
|
|
293
293
|
var N = ts(), f = e.child(N), A = e.child(f);
|
|
294
294
|
{
|
|
295
|
-
var
|
|
295
|
+
var z = (_e) => {
|
|
296
296
|
var Le = Qr();
|
|
297
297
|
e.append(_e, Le);
|
|
298
298
|
}, m = (_e) => {
|
|
@@ -316,7 +316,7 @@ function Fs(Me, v) {
|
|
|
316
316
|
e.append(_e, Le);
|
|
317
317
|
};
|
|
318
318
|
e.if(A, (_e) => {
|
|
319
|
-
e.get(I) === "submitted" ? _e(
|
|
319
|
+
e.get(I) === "submitted" ? _e(z) : _e(m, !1);
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
322
|
e.reset(f);
|
|
@@ -352,7 +352,7 @@ function Fs(Me, v) {
|
|
|
352
352
|
e.get(k), e.untrack(() => e.get(k).title || e.get(k).description) && ue(A);
|
|
353
353
|
});
|
|
354
354
|
}
|
|
355
|
-
var
|
|
355
|
+
var z = e.sibling(f, 2);
|
|
356
356
|
{
|
|
357
357
|
var m = (ue) => {
|
|
358
358
|
var _e = ls();
|
|
@@ -698,7 +698,7 @@ function Fs(Me, v) {
|
|
|
698
698
|
}
|
|
699
699
|
e.reset(_e), e.event("submit", _e, q), e.append(ue, _e);
|
|
700
700
|
};
|
|
701
|
-
e.if(
|
|
701
|
+
e.if(z, (ue) => {
|
|
702
702
|
e.get(k), e.untrack(() => e.get(k).variant === "buttons") ? ue(m) : ue(ee, !1);
|
|
703
703
|
});
|
|
704
704
|
}
|
|
@@ -709,13 +709,13 @@ function Fs(Me, v) {
|
|
|
709
709
|
});
|
|
710
710
|
}
|
|
711
711
|
e.reset(Ce), e.bind_this(Ce, (o) => e.set(Ee, o), () => e.get(Ee)), e.template_effect(() => {
|
|
712
|
-
e.set_class(Ce, 1, `artifactuse-inline-form ${e.get(s) ?? ""} ${e.get(
|
|
712
|
+
e.set_class(Ce, 1, `artifactuse-inline-form ${e.get(s) ?? ""} ${e.get(F) ?? ""}`), e.set_attribute(Ce, "data-artifactuse-theme", O());
|
|
713
713
|
}), e.append(Me, Ce), e.pop();
|
|
714
714
|
}
|
|
715
715
|
var qs = e.from_svg('<svg viewBox="0 0 24 24" fill="currentColor"><path d="M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.34 2.19c-1.39-.46-2.9-.2-3.91.81s-1.27 2.52-.81 3.91C2.63 9.33 1.75 10.57 1.75 12s.88 2.67 2.19 3.34c-.46 1.39-.2 2.9.81 3.91s2.52 1.27 3.91.81c.66 1.31 1.91 2.19 3.34 2.19s2.67-.88 3.34-2.19c1.39.46 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"></path></svg>'), Ds = e.from_html("<img/>"), Rs = e.from_html('<div class="artifactuse-social-media"><div></div></div>'), Vs = e.from_html('<img class="artifactuse-social-link-image"/>'), Us = e.from_html('<div class="artifactuse-social-link-description"> </div>'), Os = e.from_html('<div class="artifactuse-social-link-card"><!> <div class="artifactuse-social-link-info"><div class="artifactuse-social-link-domain"> </div> <div class="artifactuse-social-link-title"> </div> <!></div></div>'), Ns = e.from_html('<div class="artifactuse-social-poll-option"><div class="artifactuse-social-poll-bar"></div> <div class="artifactuse-social-poll-label"><span> </span> <span class="artifactuse-social-poll-percent"> </span></div></div>'), js = e.from_html('<div class="artifactuse-social-poll"><!> <div class="artifactuse-social-poll-meta"> </div></div>'), Js = e.from_html('<div class="artifactuse-social-quote"><div class="artifactuse-social-quote-header"><img class="artifactuse-social-quote-avatar" alt=""/> <span class="artifactuse-social-quote-author"> </span> <span class="artifactuse-social-quote-handle"> </span></div> <p class="artifactuse-social-quote-text"> </p></div>'), Xs = e.from_html('<div class="artifactuse-social-engagement"><span> </span> <span> </span> <span> </span> <span> </span></div>'), Ws = e.from_html('<div class="artifactuse-social-header"><img class="artifactuse-social-avatar"/> <div class="artifactuse-social-author"><div class="artifactuse-social-author-name"><span> </span> <!></div> <div class="artifactuse-social-author-meta"><span class="artifactuse-social-author-handle"> </span> <span class="artifactuse-social-timestamp"> </span></div></div></div> <div class="artifactuse-social-content"><p class="artifactuse-social-text"><!></p> <!> <!> <!> <!></div> <!>', 1), Zs = e.from_html('<span class="artifactuse-social-author-connection"> </span>'), Ks = e.from_html('<img class="artifactuse-social-link-image"/>'), Ys = e.from_html('<div class="artifactuse-social-link-card"><!> <div class="artifactuse-social-link-info"><div class="artifactuse-social-link-title"> </div> <div class="artifactuse-social-link-domain"> </div></div></div>'), Qs = e.from_html('<div class="artifactuse-social-engagement"><span> </span> <span> </span> <span> </span></div>'), Gs = e.from_html('<div class="artifactuse-social-header"><img class="artifactuse-social-avatar"/> <div class="artifactuse-social-author-info"><div class="artifactuse-social-author-name"> <!></div> <div class="artifactuse-social-author-headline"> </div> <div class="artifactuse-social-timestamp"> </div></div></div> <div class="artifactuse-social-content"><p class="artifactuse-social-text"><!></p> <!></div> <!>', 1), ei = e.from_svg('<svg class="artifactuse-social-verified" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"></path></svg>'), ti = e.from_html('<div class="artifactuse-social-location"> </div>'), ai = e.from_html("<img/>"), ri = e.from_html('<div class="artifactuse-social-media-placeholder"></div>'), si = e.from_html('<div class="artifactuse-social-header"><img class="artifactuse-social-avatar"/> <div class="artifactuse-social-author"><div class="artifactuse-social-author-name"> <!></div> <!></div></div> <div class="artifactuse-social-media"><!></div> <div class="artifactuse-social-likes"> </div> <div class="artifactuse-social-caption"><span class="artifactuse-social-caption-author"> </span> <span class="artifactuse-social-caption-text"><!></span></div> <div class="artifactuse-social-timestamp"> </div>', 1), ii = e.from_html("<img/>"), ni = e.from_html('<div class="artifactuse-social-media"><div class="artifactuse-social-media-grid"></div></div>'), li = e.from_html('<img class="artifactuse-social-link-image"/>'), ci = e.from_html('<div class="artifactuse-social-link-card"><!> <div class="artifactuse-social-link-info"><div class="artifactuse-social-link-domain"> </div> <div class="artifactuse-social-link-title"> </div></div></div>'), oi = e.from_html('<div class="artifactuse-social-engagement"><span> </span> <span> </span></div>'), ui = e.from_html('<div class="artifactuse-social-header"><img class="artifactuse-social-avatar"/> <div class="artifactuse-social-author"><div class="artifactuse-social-author-name"> </div> <div class="artifactuse-social-timestamp"> </div></div></div> <div class="artifactuse-social-content"><p class="artifactuse-social-text"><!></p> <!> <!></div> <!>', 1), vi = e.from_svg('<svg class="artifactuse-social-verified" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"></path></svg>'), di = e.from_html('<div class="artifactuse-social-engagement"><span> </span> <span> </span> <span> </span></div>'), pi = e.from_html('<div class="artifactuse-social-header"><img class="artifactuse-social-avatar"/> <div class="artifactuse-social-author"><div class="artifactuse-social-author-name"> <!></div></div> <span class="artifactuse-social-timestamp"> </span></div> <div class="artifactuse-social-content"><p class="artifactuse-social-text"><!></p></div> <!>', 1), _i = e.from_html('<img alt="Video thumbnail"/>'), fi = e.from_html('<div class="artifactuse-social-thumbnail-placeholder"></div>'), gi = e.from_html('<div class="artifactuse-social-duration"> </div>'), mi = e.from_html('<div class="artifactuse-social-sound"> </div>'), hi = e.from_html('<div class="artifactuse-social-engagement"><span> </span> <span> </span> <span> </span></div>'), bi = e.from_html('<div class="artifactuse-social-thumbnail"><!> <!></div> <div class="artifactuse-social-info"><div class="artifactuse-social-header"><img class="artifactuse-social-avatar"/> <span class="artifactuse-social-author-name"> </span></div> <p class="artifactuse-social-text"><!></p> <!></div> <!>', 1), ki = e.from_html('<img alt="Video thumbnail"/>'), yi = e.from_html('<div class="artifactuse-social-thumbnail-placeholder"></div>'), xi = e.from_html('<div class="artifactuse-social-duration"> </div>'), wi = e.from_html('<div class="artifactuse-social-thumbnail"><!> <!></div> <div class="artifactuse-social-info"><img class="artifactuse-social-avatar"/> <div class="artifactuse-social-details"><div class="artifactuse-social-title"> </div> <div class="artifactuse-social-channel"> </div> <div class="artifactuse-social-meta"> </div></div></div>', 1), Ci = e.from_html('<div><!> <div class="artifactuse-social-actions-bar"><div class="artifactuse-social-platform-badge"><span> </span></div> <div class="artifactuse-social-actions-right"><span> </span> <button class="artifactuse-social-copy-btn"> </button></div></div></div>');
|
|
716
716
|
function $i(Me, v) {
|
|
717
717
|
e.push(v, !1);
|
|
718
|
-
const fe = e.mutable_source(),
|
|
718
|
+
const fe = e.mutable_source(), F = e.mutable_source(), k = e.mutable_source(), i = e.mutable_source(), s = e.mutable_source(), d = e.mutable_source(), L = e.mutable_source(), a = e.mutable_source(), Se = e.mutable_source(), ye = e.mutable_source(), O = e.mutable_source(), re = e.mutable_source(), Te = e.mutable_source();
|
|
719
719
|
let pe = e.prop(v, "artifact", 8), Ee = e.prop(v, "theme", 8, "dark");
|
|
720
720
|
const y = la(), _ = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23888"><circle cx="12" cy="8" r="4"/><path d="M12 14c-6 0-8 3-8 6v2h16v-2c0-3-2-6-8-6z"/></svg>', E = {
|
|
721
721
|
twitter: 280,
|
|
@@ -771,7 +771,7 @@ function $i(Me, v) {
|
|
|
771
771
|
e.set(Pe, "Copy");
|
|
772
772
|
},
|
|
773
773
|
2e3
|
|
774
|
-
), y("copy", { platform: e.get(
|
|
774
|
+
), y("copy", { platform: e.get(F), text: m });
|
|
775
775
|
});
|
|
776
776
|
}
|
|
777
777
|
e.legacy_pre_effect(() => e.deep_read_state(pe()), () => {
|
|
@@ -779,7 +779,7 @@ function $i(Me, v) {
|
|
|
779
779
|
e.set(fe, me((m = pe()) == null ? void 0 : m.code));
|
|
780
780
|
}), e.legacy_pre_effect(() => e.get(fe), () => {
|
|
781
781
|
var m;
|
|
782
|
-
e.set(
|
|
782
|
+
e.set(F, ((m = e.get(fe)) == null ? void 0 : m.platform) || "twitter");
|
|
783
783
|
}), e.legacy_pre_effect(() => e.get(fe), () => {
|
|
784
784
|
var m;
|
|
785
785
|
e.set(k, ((m = e.get(fe)) == null ? void 0 : m.data) || {});
|
|
@@ -793,8 +793,8 @@ function $i(Me, v) {
|
|
|
793
793
|
e.set(L, e.get(k).meta || {});
|
|
794
794
|
}), e.legacy_pre_effect(() => e.get(s), () => {
|
|
795
795
|
e.set(a, e.get(s).media || []);
|
|
796
|
-
}), e.legacy_pre_effect(() => e.get(
|
|
797
|
-
e.set(Se, E[e.get(
|
|
796
|
+
}), e.legacy_pre_effect(() => e.get(F), () => {
|
|
797
|
+
e.set(Se, E[e.get(F)] || 280);
|
|
798
798
|
}), e.legacy_pre_effect(() => e.get(s), () => {
|
|
799
799
|
e.set(ye, (e.get(s).text || "").length);
|
|
800
800
|
}), e.legacy_pre_effect(() => (e.get(ye), e.get(Se)), () => {
|
|
@@ -1364,7 +1364,7 @@ function $i(Me, v) {
|
|
|
1364
1364
|
e.if(
|
|
1365
1365
|
G,
|
|
1366
1366
|
(x) => {
|
|
1367
|
-
e.get(
|
|
1367
|
+
e.get(F) === "youtube" && x($);
|
|
1368
1368
|
},
|
|
1369
1369
|
!0
|
|
1370
1370
|
);
|
|
@@ -1374,7 +1374,7 @@ function $i(Me, v) {
|
|
|
1374
1374
|
e.if(
|
|
1375
1375
|
le,
|
|
1376
1376
|
(D) => {
|
|
1377
|
-
e.get(
|
|
1377
|
+
e.get(F) === "tiktok" ? D(se) : D($e, !1);
|
|
1378
1378
|
},
|
|
1379
1379
|
!0
|
|
1380
1380
|
);
|
|
@@ -1384,7 +1384,7 @@ function $i(Me, v) {
|
|
|
1384
1384
|
e.if(
|
|
1385
1385
|
C,
|
|
1386
1386
|
(de) => {
|
|
1387
|
-
e.get(
|
|
1387
|
+
e.get(F) === "threads" ? de(T) : de(ie, !1);
|
|
1388
1388
|
},
|
|
1389
1389
|
!0
|
|
1390
1390
|
);
|
|
@@ -1394,7 +1394,7 @@ function $i(Me, v) {
|
|
|
1394
1394
|
e.if(
|
|
1395
1395
|
Y,
|
|
1396
1396
|
(V) => {
|
|
1397
|
-
e.get(
|
|
1397
|
+
e.get(F) === "facebook" ? V(X) : V(g, !1);
|
|
1398
1398
|
},
|
|
1399
1399
|
!0
|
|
1400
1400
|
);
|
|
@@ -1404,7 +1404,7 @@ function $i(Me, v) {
|
|
|
1404
1404
|
e.if(
|
|
1405
1405
|
be,
|
|
1406
1406
|
(l) => {
|
|
1407
|
-
e.get(
|
|
1407
|
+
e.get(F) === "instagram" ? l(t) : l(ve, !1);
|
|
1408
1408
|
},
|
|
1409
1409
|
!0
|
|
1410
1410
|
);
|
|
@@ -1414,7 +1414,7 @@ function $i(Me, v) {
|
|
|
1414
1414
|
e.if(
|
|
1415
1415
|
ue,
|
|
1416
1416
|
(te) => {
|
|
1417
|
-
e.get(
|
|
1417
|
+
e.get(F) === "linkedin" ? te(_e) : te(Le, !1);
|
|
1418
1418
|
},
|
|
1419
1419
|
!0
|
|
1420
1420
|
);
|
|
@@ -1422,29 +1422,29 @@ function $i(Me, v) {
|
|
|
1422
1422
|
e.append(m, ee);
|
|
1423
1423
|
};
|
|
1424
1424
|
e.if(Ae, (m) => {
|
|
1425
|
-
e.get(
|
|
1425
|
+
e.get(F) === "twitter" ? m(q) : m(we, !1);
|
|
1426
1426
|
});
|
|
1427
1427
|
}
|
|
1428
1428
|
var Ce = e.sibling(Ae, 2), qe = e.child(Ce), nt = e.child(qe), Ne = e.child(nt, !0);
|
|
1429
1429
|
e.reset(nt), e.reset(qe);
|
|
1430
1430
|
var o = e.sibling(qe, 2), N = e.child(o), f = e.child(N);
|
|
1431
1431
|
e.reset(N);
|
|
1432
|
-
var A = e.sibling(N, 2),
|
|
1432
|
+
var A = e.sibling(N, 2), z = e.child(A, !0);
|
|
1433
1433
|
e.reset(A), e.reset(o), e.reset(Ce), e.reset(Oe), e.template_effect(() => {
|
|
1434
|
-
e.set_class(Oe, 1, `artifactuse-social artifactuse-social-${e.get(
|
|
1434
|
+
e.set_class(Oe, 1, `artifactuse-social artifactuse-social-${e.get(F) ?? ""}`), e.set_attribute(Oe, "data-artifactuse-theme", Ee()), e.set_text(Ne, (e.get(F), e.untrack(() => I[e.get(F)] || e.get(F)))), e.set_class(N, 1, `artifactuse-social-char-counter ${e.get(O) ?? ""}`), e.set_text(f, `${e.get(ye) ?? ""}/${e.get(Se) ?? ""}`), e.set_text(z, e.get(Pe));
|
|
1435
1435
|
}), e.event("click", A, Ve), e.append(Me, Oe), e.pop();
|
|
1436
1436
|
}
|
|
1437
1437
|
var Ai = e.from_html('<button type="button" class="artifactuse-viewer-image-button"><img/></button>'), Li = e.from_html('<iframe class="artifactuse-viewer-pdf"></iframe>'), Pi = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="11" y1="8" x2="11" y2="14"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg>'), Si = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg>'), Ei = e.from_html('<div class="artifactuse-viewer-controls"><button class="artifactuse-viewer-control"><!></button> <button class="artifactuse-viewer-control" title="Download"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg></button></div>'), Ti = e.from_html('<div class="artifactuse-viewer-caption"> </div>'), Bi = e.from_html('<div class="artifactuse-viewer-overlay" tabindex="-1" role="dialog" aria-modal="true"><div class="artifactuse-viewer-content"><!> <!> <button class="artifactuse-viewer-close" title="Close (Esc)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button> <!> <!></div></div>');
|
|
1438
1438
|
function Hi(Me, v) {
|
|
1439
1439
|
e.push(v, !1);
|
|
1440
|
-
let fe = e.prop(v, "isOpen", 8, !1),
|
|
1440
|
+
let fe = e.prop(v, "isOpen", 8, !1), F = e.prop(v, "type", 8, "image"), k = e.prop(v, "src", 8, ""), i = e.prop(v, "alt", 8, ""), s = e.prop(v, "caption", 8, "");
|
|
1441
1441
|
const d = la();
|
|
1442
1442
|
let L = e.mutable_source(), a = e.mutable_source(!1);
|
|
1443
1443
|
function Se() {
|
|
1444
1444
|
e.set(a, !1), d("close");
|
|
1445
1445
|
}
|
|
1446
1446
|
function ye() {
|
|
1447
|
-
|
|
1447
|
+
F() === "image" && e.set(a, !e.get(a));
|
|
1448
1448
|
}
|
|
1449
1449
|
function O() {
|
|
1450
1450
|
const _ = document.createElement("a");
|
|
@@ -1479,7 +1479,7 @@ function Hi(Me, v) {
|
|
|
1479
1479
|
}), e.event("click", q, ye), e.append(Ae, q);
|
|
1480
1480
|
};
|
|
1481
1481
|
e.if(Pe, (Ae) => {
|
|
1482
|
-
|
|
1482
|
+
F() === "image" && Ae(me);
|
|
1483
1483
|
});
|
|
1484
1484
|
}
|
|
1485
1485
|
var oe = e.sibling(Pe, 2);
|
|
@@ -1491,7 +1491,7 @@ function Hi(Me, v) {
|
|
|
1491
1491
|
}), e.append(Ae, q);
|
|
1492
1492
|
};
|
|
1493
1493
|
e.if(oe, (Ae) => {
|
|
1494
|
-
|
|
1494
|
+
F() === "pdf" && Ae(Ke);
|
|
1495
1495
|
});
|
|
1496
1496
|
}
|
|
1497
1497
|
var Ie = e.sibling(oe, 2), xe = e.sibling(Ie, 2);
|
|
@@ -1515,7 +1515,7 @@ function Hi(Me, v) {
|
|
|
1515
1515
|
e.reset(q), e.template_effect(() => e.set_attribute(we, "title", e.get(a) ? "Zoom out" : "Zoom in")), e.event("click", we, e.stopPropagation(ye)), e.event("click", Ne, e.stopPropagation(O)), e.append(Ae, q);
|
|
1516
1516
|
};
|
|
1517
1517
|
e.if(xe, (Ae) => {
|
|
1518
|
-
|
|
1518
|
+
F() === "image" && Ae(Fe);
|
|
1519
1519
|
});
|
|
1520
1520
|
}
|
|
1521
1521
|
var Ve = e.sibling(xe, 2);
|
|
@@ -1536,10 +1536,10 @@ function Hi(Me, v) {
|
|
|
1536
1536
|
}
|
|
1537
1537
|
e.append(Me, pe), e.pop();
|
|
1538
1538
|
}
|
|
1539
|
-
var Mi = e.from_html("<div><!></div>"), Ii = e.from_html('<div class="artifactuse-agent-message"><div class="artifactuse-message-content"></div> <!></div>');
|
|
1539
|
+
var Mi = e.from_html("<div><!></div>"), Ii = e.from_html('<div class="artifactuse-agent-message"><div class="artifactuse-message-content" role="presentation"></div> <!></div>');
|
|
1540
1540
|
function Dn(Me, v) {
|
|
1541
1541
|
e.push(v, !1);
|
|
1542
|
-
const fe = e.mutable_source(),
|
|
1542
|
+
const fe = e.mutable_source(), F = e.mutable_source(), k = e.mutable_source(), i = e.mutable_source();
|
|
1543
1543
|
let s = e.prop(v, "content", 8, ""), d = e.prop(v, "messageId", 24, () => `msg-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`), L = e.prop(v, "inlineCards", 8, !0), a = e.prop(v, "typing", 8, !1), Se = e.prop(
|
|
1544
1544
|
v,
|
|
1545
1545
|
"isLastMessage",
|
|
@@ -1673,10 +1673,11 @@ function Dn(Me, v) {
|
|
|
1673
1673
|
100
|
|
1674
1674
|
);
|
|
1675
1675
|
}
|
|
1676
|
-
function
|
|
1676
|
+
function z(l) {
|
|
1677
1677
|
var Y;
|
|
1678
1678
|
const c = l.target.closest(".artifactuse-inline-preview");
|
|
1679
1679
|
if (c) {
|
|
1680
|
+
if (c.dataset.nonClickable) return;
|
|
1680
1681
|
const X = c.dataset.artifactId;
|
|
1681
1682
|
if (X) {
|
|
1682
1683
|
const g = (Y = E == null ? void 0 : E.state) == null ? void 0 : Y.getArtifact(X);
|
|
@@ -1714,7 +1715,7 @@ function Dn(Me, v) {
|
|
|
1714
1715
|
e.set(fe, typeof _ == "function" ? _() : "dark");
|
|
1715
1716
|
}), e.legacy_pre_effect(() => {
|
|
1716
1717
|
}, () => {
|
|
1717
|
-
e.set(
|
|
1718
|
+
e.set(F, I || null);
|
|
1718
1719
|
}), e.legacy_pre_effect(() => e.deep_read_state(L()), () => {
|
|
1719
1720
|
var l;
|
|
1720
1721
|
e.set(k, L() ?? ((l = E == null ? void 0 : E.config) == null ? void 0 : l.inlineCards) ?? !0);
|
|
@@ -1791,7 +1792,7 @@ function Dn(Me, v) {
|
|
|
1791
1792
|
{
|
|
1792
1793
|
var x = (H) => {
|
|
1793
1794
|
{
|
|
1794
|
-
let R = e.derived_safe_equal(() => (e.get(
|
|
1795
|
+
let R = e.derived_safe_equal(() => (e.get(F), e.get(c), e.untrack(() => e.get(F) === e.get(c).artifact.id)));
|
|
1795
1796
|
Yr(H, {
|
|
1796
1797
|
get artifact() {
|
|
1797
1798
|
return e.get(c), e.untrack(() => e.get(c).artifact);
|
|
@@ -1862,12 +1863,12 @@ function Dn(Me, v) {
|
|
|
1862
1863
|
return e.get(Ce);
|
|
1863
1864
|
},
|
|
1864
1865
|
$$events: { close: o }
|
|
1865
|
-
}), e.reset(be), e.bind_this(be, (l) => e.set(Pe, l), () => e.get(Pe)), e.event("click", t,
|
|
1866
|
+
}), e.reset(be), e.bind_this(be, (l) => e.set(Pe, l), () => e.get(Pe)), e.event("click", t, z), e.event("keydown", t, z), e.append(Me, be), e.pop();
|
|
1866
1867
|
}
|
|
1867
1868
|
var zi = e.from_html('<button class="artifactuse-panel__resize-handle" aria-label="Resize panel"><div class="artifactuse-panel__resize-handle-line"></div></button>'), Fi = e.from_html('<a href="https://artifactuse.com" target="_blank" rel="noopener noreferrer" class="artifactuse-panel__branding"><svg width="16" height="16" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0" fill="#5F51C8"></path><path d="M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z" fill="#695AE0"></path></svg> <span>Artifactuse</span></a>'), qi = e.from_html('<div><!> <header class="artifactuse-panel__header artifactuse-panel__header--simple"><div class="artifactuse-panel__title"><span class="artifactuse-panel__icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg></span> <div class="artifactuse-panel__title-content"><span class="artifactuse-panel__name">Artifacts</span></div></div> <div class="artifactuse-panel__actions"><button class="artifactuse-panel__action artifactuse-panel__action--close" title="Close panel"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div></header> <div class="artifactuse-panel__empty"><div class="artifactuse-panel__empty-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"></path><polyline points="14 2 14 8 20 8"></polyline></svg></div> <h3 class="artifactuse-panel__empty-title">No artifacts yet</h3> <p class="artifactuse-panel__empty-text">Code blocks, forms, and other interactive content will appear here as the AI generates them.</p></div> <footer class="artifactuse-panel__footer artifactuse-panel__footer--simple"><!></footer></div>'), Di = e.from_html('<button class="artifactuse-panel__resize-handle" aria-label="Resize panel"><div class="artifactuse-panel__resize-handle-line"></div></button>'), Ri = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>'), Vi = e.from_svg('<svg class="artifactuse-panel__spinner-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10" stroke-dasharray="32" stroke-dashoffset="32"></circle></svg>'), Ui = e.from_html('<button class="artifactuse-panel__list-item"><span class="artifactuse-panel__list-item-icon"><!></span> <div class="artifactuse-panel__list-item-content"><span class="artifactuse-panel__list-item-title"> </span> <span class="artifactuse-panel__list-item-meta"> <!></span></div> <span class="artifactuse-panel__list-item-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"></polyline></svg></span></button>'), Oi = e.from_html('<a href="https://artifactuse.com" target="_blank" rel="noopener noreferrer" class="artifactuse-panel__branding"><svg width="16" height="16" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0" fill="#5F51C8"></path><path d="M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z" fill="#695AE0"></path></svg> <span>Artifactuse</span></a>'), Ni = e.from_html('<div><!> <header class="artifactuse-panel__header artifactuse-panel__header--simple"><div class="artifactuse-panel__title"><span class="artifactuse-panel__icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg></span> <div class="artifactuse-panel__title-content"><span class="artifactuse-panel__name">Artifacts</span> <span class="artifactuse-panel__meta"> </span></div></div> <div class="artifactuse-panel__actions"><button title="Download all as ZIP"><!></button> <button class="artifactuse-panel__action artifactuse-panel__action--close" title="Close panel"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div></header> <div class="artifactuse-panel__list"><div class="artifactuse-panel__list-items"></div></div> <footer class="artifactuse-panel__footer artifactuse-panel__footer--simple"><!></footer></div>'), ji = e.from_html('<button class="artifactuse-panel__resize-handle" aria-label="Resize panel"><div class="artifactuse-panel__resize-handle-line"></div></button>'), Ji = e.from_html('<button class="artifactuse-panel__back" title="Back to list"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"></polyline></svg></button>'), Xi = e.from_html('<button title="Preview"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg></button>'), Wi = e.from_html('<button title="Code"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg></button>'), Zi = e.from_html('<button title="Split view"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="12" y1="3" x2="12" y2="21"></line></svg></button>'), Ki = e.from_html('<button title="Edit"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg></button>'), Yi = e.from_html('<button class="artifactuse-panel__action artifactuse-panel__action--save" title="Save"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"></path><polyline points="17 21 17 13 7 13 7 21"></polyline><polyline points="7 3 7 8 15 8"></polyline></svg></button>'), Qi = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" y1="3" x2="14" y2="10"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg>'), Gi = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 14 10 14 10 20"></polyline><polyline points="20 10 14 10 14 4"></polyline><line x1="14" y1="10" x2="21" y2="3"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg>'), en = e.from_html('<div class="artifactuse-panel__loading"><div class="artifactuse-panel__spinner"></div></div>'), tn = e.from_html('<div class="artifactuse-panel__loading"><div class="artifactuse-panel__spinner"></div></div>'), an = e.from_html('<iframe sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation" allow="camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write" title="Artifact Preview"></iframe>'), rn = e.from_html('<div class="artifactuse-panel__no-preview"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M9 17H7A5 5 0 0 1 7 7h2"></path><path d="M15 7h2a5 5 0 1 1 0 10h-2"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg> <p> </p></div>'), sn = e.from_html('<div class="artifactuse-panel__preview"><!> <!></div>'), nn = e.from_html('<button class="artifactuse-panel__split-handle" aria-label="Split Resize"><div class="artifactuse-panel__split-handle-line"></div></button>'), ln = e.from_html('<a href="https://artifactuse.com" target="_blank" rel="noopener noreferrer" class="artifactuse-panel__branding" title="Powered by Artifactuse"><svg width="16" height="16" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0" fill="#5F51C8"></path><path d="M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z" fill="#695AE0"></path></svg> <span>Artifactuse</span></a>'), cn = e.from_html('<span class="artifactuse-panel__badge artifactuse-panel__badge--secondary"> </span>'), on = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>'), un = e.from_svg('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"></polyline></svg>'), vn = e.from_html('<div class="artifactuse-share-popup__loading"><div class="artifactuse-share-popup__spinner"></div> <p class="artifactuse-share-popup__loading-text">Creating link...</p></div>'), dn = e.from_html('<div><div class="artifactuse-share-popup__error"><p class="artifactuse-share-popup__error-text"> </p></div> <div class="artifactuse-share-popup__actions"><button class="artifactuse-share-popup__btn artifactuse-share-popup__btn--secondary">Back</button> <button class="artifactuse-share-popup__btn artifactuse-share-popup__btn--primary">Retry</button></div></div>'), pn = e.from_html('<div class="artifactuse-share-popup__options"><button class="artifactuse-share-popup__option"><div class="artifactuse-share-popup__option-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg></div> <div class="artifactuse-share-popup__option-content"><p class="artifactuse-share-popup__option-title">Share link</p> <p class="artifactuse-share-popup__option-desc">Expires in 30 days</p></div></button> <button class="artifactuse-share-popup__option"><div class="artifactuse-share-popup__option-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"></path><polyline points="17 21 17 13 7 13 7 21"></polyline><polyline points="7 3 7 8 15 8"></polyline></svg></div> <div class="artifactuse-share-popup__option-content"><p class="artifactuse-share-popup__option-title">Save to account</p> <p class="artifactuse-share-popup__option-desc">Permanent, manageable</p></div></button> <button class="artifactuse-share-popup__option"><div class="artifactuse-share-popup__option-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path></svg></div> <div class="artifactuse-share-popup__option-content"><p class="artifactuse-share-popup__option-title">Update saved</p> <p class="artifactuse-share-popup__option-desc">Replace an existing artifact</p></div></button></div>'), _n = e.from_html('<div class="artifactuse-share-popup__loading"><div class="artifactuse-share-popup__spinner"></div> <p class="artifactuse-share-popup__loading-text">Loading artifacts...</p></div>'), fn = e.from_html('<div class="artifactuse-share-popup__empty">No saved artifacts of this type</div>'), gn = e.from_html('<button class="artifactuse-share-popup__artifact-item"><span class="artifactuse-share-popup__artifact-name"> </span> <span class="artifactuse-share-popup__artifact-date"> </span></button>'), mn = e.from_html('<div class="artifactuse-share-popup__artifact-list"></div>'), hn = e.from_html('<div><!> <button class="artifactuse-share-popup__back-btn">Back</button></div>'), bn = e.from_html('<div class="artifactuse-share-popup__expiry"><span class="artifactuse-share-popup__expiry-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg></span> <span class="artifactuse-share-popup__expiry-text"> </span></div>'), kn = e.from_html('<div class="artifactuse-share-popup__save-prompt"><p class="artifactuse-share-popup__save-prompt-text">Keep it permanently?</p> <button class="artifactuse-share-popup__save-prompt-btn">Save to account</button></div>'), yn = e.from_html('<div class="artifactuse-share-popup__success"><div class="artifactuse-share-popup__success-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"></polyline></svg></div> <div class="artifactuse-share-popup__link-wrapper"><input type="text" class="artifactuse-share-popup__link" readonly=""/> <button> </button></div> <!> <!></div>'), xn = e.from_html('<div class="artifactuse-share-popup"><div class="artifactuse-share-popup__header"><span class="artifactuse-share-popup__title"> </span> <button aria-label="share" class="artifactuse-share-popup__close"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div> <div class="artifactuse-share-popup__body"><!></div> <div class="artifactuse-share-popup__footer"><a href="https://artifactuse.com" target="_blank" rel="noopener noreferrer" class="artifactuse-share-popup__branding"><svg width="12" height="12" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0" fill="#5F51C8"></path><path d="M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z" fill="#695AE0"></path></svg> <span>Powered by Artifactuse</span></a></div></div>'), wn = e.from_html('<div style="position: relative;"><button class="artifactuse-panel__footer-action" title="Share"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line></svg></button> <!></div>'), Cn = e.from_html('<button><span class="artifactuse-panel__artifact-item-icon"><!></span> <div class="artifactuse-panel__artifact-item-content"><span class="artifactuse-panel__artifact-item-title"> </span> <span class="artifactuse-panel__artifact-item-meta"> <!></span></div> <span class="artifactuse-panel__artifact-item-index"> </span></button>'), $n = e.from_html('<div class="artifactuse-panel__artifact-list"><div class="artifactuse-panel__artifact-list-header"><span> </span> <button class="artifactuse-panel__artifact-list-close" aria-label="Close artifact list"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div> <div class="artifactuse-panel__artifact-list-items"></div></div>'), An = e.from_html('<div class="artifactuse-panel__nav"><button class="artifactuse-panel__nav-btn" title="Previous artifact"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"></polyline></svg></button> <button class="artifactuse-panel__nav-trigger"><span> </span> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg></button> <button class="artifactuse-panel__nav-btn" title="Next artifact"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"></polyline></svg></button> <!></div>'), Ln = e.from_html('<div><!> <header class="artifactuse-panel__header"><!> <div class="artifactuse-panel__title"><span class="artifactuse-panel__icon"><svg viewBox="0 0 24 24" fill="currentColor"><!></svg></span> <div class="artifactuse-panel__title-content"><span class="artifactuse-panel__name"> </span> <span class="artifactuse-panel__meta"> <!></span></div></div> <div class="artifactuse-panel__tabs"><!> <!> <!> <!></div> <div class="artifactuse-panel__actions"><!> <button class="artifactuse-panel__action"><!></button> <button class="artifactuse-panel__action artifactuse-panel__action--close" title="Close"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div></header> <div><!> <!> <div class="artifactuse-panel__code"><!> <div class="artifactuse-panel__code-scroll"><div class="artifactuse-panel__line-numbers"></div> <pre><code></code></pre></div></div> <div class="artifactuse-panel__edit"><div class="artifactuse-panel__editor-container"></div></div></div> <footer class="artifactuse-panel__footer"><div class="artifactuse-panel__footer-left"><!> <!></div> <div class="artifactuse-panel__footer-right"><button><!></button> <button class="artifactuse-panel__footer-action" title="Download"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg></button> <!> <!></div></footer></div>');
|
|
1868
1869
|
function Rn(Me, v) {
|
|
1869
1870
|
e.push(v, !1);
|
|
1870
|
-
const fe = () => e.store_get(q, "$activeArtifact", s),
|
|
1871
|
+
const fe = () => e.store_get(q, "$activeArtifact", s), F = () => e.store_get(Ae, "$state", s), k = () => e.store_get(we, "$artifactCount", s), i = () => e.store_get(Ce, "$hasArtifacts", s), [s, d] = e.setup_stores(), L = e.mutable_source(), a = e.mutable_source(), Se = e.mutable_source(), ye = e.mutable_source(), O = e.mutable_source(), re = e.mutable_source(), Te = e.mutable_source(), pe = e.mutable_source(), Ee = e.mutable_source(), y = e.mutable_source(), _ = e.mutable_source(), E = e.mutable_source(), I = e.mutable_source(), Pe = e.mutable_source(), me = e.mutable_source(), oe = e.mutable_source(), Ke = e.mutable_source(), Ie = e.mutable_source(), xe = e.mutable_source(), Fe = e.mutable_source(), Ve = la();
|
|
1871
1872
|
let Oe = e.prop(v, "className", 8, "");
|
|
1872
1873
|
const {
|
|
1873
1874
|
state: Ae,
|
|
@@ -1881,7 +1882,7 @@ function Rn(Me, v) {
|
|
|
1881
1882
|
openArtifact: N,
|
|
1882
1883
|
instance: f
|
|
1883
1884
|
} = Ua();
|
|
1884
|
-
let A = e.mutable_source(),
|
|
1885
|
+
let A = e.mutable_source(), z = e.mutable_source(), m = e.mutable_source(), ee = e.mutable_source(), ue = e.mutable_source(), _e = e.mutable_source(), Le = e.mutable_source(!1), te = e.mutable_source(!1), he = e.mutable_source(!0), be = e.mutable_source(!1), t = e.mutable_source(!1), ve = e.mutable_source(!1), l = e.mutable_source(!1), c = e.mutable_source(
|
|
1885
1886
|
"options"
|
|
1886
1887
|
// 'options' | 'email' | 'loading' | 'success' | 'verify' | 'error'
|
|
1887
1888
|
), Y = e.mutable_source(""), X = e.mutable_source(null), g = e.mutable_source(""), V = e.mutable_source(!1), r = e.mutable_source(!1), C = e.mutable_source([]), T = e.mutable_source(!1), ie = e.mutable_source(""), de = e.mutable_source(65), ke = e.mutable_source(50), le = null, se = null, $e = null, D = null, B = null, G = null, $ = null, x = null;
|
|
@@ -1929,22 +1930,22 @@ function Rn(Me, v) {
|
|
|
1929
1930
|
}
|
|
1930
1931
|
function h() {
|
|
1931
1932
|
var n;
|
|
1932
|
-
if (e.get(
|
|
1933
|
+
if (e.get(z) && wr() && ((n = e.get(a)) != null && n.code)) {
|
|
1933
1934
|
const K = w(e.get(a));
|
|
1934
1935
|
if (K)
|
|
1935
|
-
e.mutate(
|
|
1936
|
+
e.mutate(z, e.get(z).innerHTML = K.html);
|
|
1936
1937
|
else {
|
|
1937
1938
|
const Be = window.Prism.languages[e.get(E)];
|
|
1938
|
-
Be ? e.mutate(
|
|
1939
|
+
Be ? e.mutate(z, e.get(z).innerHTML = window.Prism.highlight(e.get(a).code, Be, e.get(E))) : e.mutate(z, e.get(z).textContent = e.get(a).code);
|
|
1939
1940
|
}
|
|
1940
|
-
e.mutate(
|
|
1941
|
+
e.mutate(z, e.get(z).dataset.highlighted = "true"), Jt().then(() => {
|
|
1941
1942
|
j();
|
|
1942
1943
|
});
|
|
1943
1944
|
}
|
|
1944
1945
|
}
|
|
1945
1946
|
function j() {
|
|
1946
1947
|
var K;
|
|
1947
|
-
const n = (K = e.get(
|
|
1948
|
+
const n = (K = e.get(z)) == null ? void 0 : K.closest("pre");
|
|
1948
1949
|
if (n && e.get(ue) && e.get(ee)) {
|
|
1949
1950
|
const De = window.getComputedStyle(n).backgroundColor;
|
|
1950
1951
|
De && De !== "rgba(0, 0, 0, 0)" && De !== "transparent" && (e.mutate(ue, e.get(ue).style.backgroundColor = De), e.mutate(ee, e.get(ee).style.backgroundColor = De));
|
|
@@ -2184,14 +2185,14 @@ function Rn(Me, v) {
|
|
|
2184
2185
|
e.set(L, ((n = f.editor) == null ? void 0 : n.isAvailable()) || !1);
|
|
2185
2186
|
}), e.legacy_pre_effect(() => fe(), () => {
|
|
2186
2187
|
e.set(a, fe());
|
|
2187
|
-
}), e.legacy_pre_effect(() =>
|
|
2188
|
-
e.set(Se,
|
|
2189
|
-
}), e.legacy_pre_effect(() =>
|
|
2190
|
-
e.set(ye,
|
|
2191
|
-
}), e.legacy_pre_effect(() =>
|
|
2192
|
-
e.set(O,
|
|
2193
|
-
}), e.legacy_pre_effect(() =>
|
|
2194
|
-
e.set(re,
|
|
2188
|
+
}), e.legacy_pre_effect(() => F(), () => {
|
|
2189
|
+
e.set(Se, F().artifacts);
|
|
2190
|
+
}), e.legacy_pre_effect(() => F(), () => {
|
|
2191
|
+
e.set(ye, F().isPanelOpen);
|
|
2192
|
+
}), e.legacy_pre_effect(() => F(), () => {
|
|
2193
|
+
e.set(O, F().viewMode);
|
|
2194
|
+
}), e.legacy_pre_effect(() => F(), () => {
|
|
2195
|
+
e.set(re, F().isFullscreen);
|
|
2195
2196
|
}), e.legacy_pre_effect(() => k(), () => {
|
|
2196
2197
|
e.set(Te, k());
|
|
2197
2198
|
}), e.legacy_pre_effect(() => i(), () => {
|
|
@@ -2526,7 +2527,7 @@ function Rn(Me, v) {
|
|
|
2526
2527
|
var Ya = e.sibling(dr, 2), pr = e.child(Ya);
|
|
2527
2528
|
e.bind_this(pr, (u) => e.set(ee, u), () => e.get(ee));
|
|
2528
2529
|
var Qa = e.sibling(pr, 2), _r = e.child(Qa);
|
|
2529
|
-
e.bind_this(_r, (u) => e.set(
|
|
2530
|
+
e.bind_this(_r, (u) => e.set(z, u), () => e.get(z)), e.reset(Qa), e.reset(Ya), e.bind_this(Ya, (u) => e.set(ue, u), () => e.get(ue)), e.reset(za);
|
|
2530
2531
|
var Ga = e.sibling(za, 2), Tr = e.child(Ga);
|
|
2531
2532
|
e.bind_this(Tr, (u) => e.set(_e, u), () => e.get(_e)), e.reset(Ga), e.reset(ka), e.bind_this(ka, (u) => e.set(m, u), () => e.get(m));
|
|
2532
2533
|
var fr = e.sibling(ka, 2), er = e.child(fr), gr = e.child(er);
|
|
@@ -2832,11 +2833,11 @@ function Rn(Me, v) {
|
|
|
2832
2833
|
var Pn = e.from_html('<span class="artifactuse-panel-toggle-badge"> </span>'), Sn = e.from_html('<button><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg> <!></button>');
|
|
2833
2834
|
function Vn(Me, v) {
|
|
2834
2835
|
e.push(v, !1);
|
|
2835
|
-
const fe = () => e.store_get(O, "$isPanelOpen", i),
|
|
2836
|
+
const fe = () => e.store_get(O, "$isPanelOpen", i), F = () => e.store_get(re, "$artifactCount", i), k = () => e.store_get(Te, "$hasArtifacts", i), [i, s] = e.setup_stores(), d = e.mutable_source(), L = e.mutable_source(), a = e.mutable_source(), Se = e.mutable_source(), ye = e.mutable_source(), { isPanelOpen: O, artifactCount: re, hasArtifacts: Te, togglePanel: pe } = Ua();
|
|
2836
2837
|
e.legacy_pre_effect(() => fe(), () => {
|
|
2837
2838
|
e.set(d, fe());
|
|
2838
|
-
}), e.legacy_pre_effect(() =>
|
|
2839
|
-
e.set(L,
|
|
2839
|
+
}), e.legacy_pre_effect(() => F(), () => {
|
|
2840
|
+
e.set(L, F());
|
|
2840
2841
|
}), e.legacy_pre_effect(() => k(), () => {
|
|
2841
2842
|
e.set(a, k());
|
|
2842
2843
|
}), e.legacy_pre_effect(() => e.get(L), () => {
|
|
@@ -2864,10 +2865,10 @@ function Vn(Me, v) {
|
|
|
2864
2865
|
}
|
|
2865
2866
|
const $r = "artifactuse";
|
|
2866
2867
|
function cr(Me = {}) {
|
|
2867
|
-
const v = jr(Me), fe = na([]),
|
|
2868
|
-
fe.set(y.artifacts),
|
|
2868
|
+
const v = jr(Me), fe = na([]), F = na(null), k = na(!1), i = na("preview"), s = na(!1), d = na(v.getPanelTypes()), L = v.state.subscribe((y) => {
|
|
2869
|
+
fe.set(y.artifacts), F.set(y.activeArtifactId), k.set(y.isPanelOpen), i.set(y.viewMode), s.set(y.isFullscreen);
|
|
2869
2870
|
}), a = Ra(
|
|
2870
|
-
[fe,
|
|
2871
|
+
[fe, F],
|
|
2871
2872
|
([y, _]) => _ && y.find((E) => E.id === _) || null
|
|
2872
2873
|
), Se = Ra(fe, (y) => y.filter((_) => !_.isInline).length), ye = Ra(fe, (y) => y.some((_) => !_.isInline)), O = Ra(a, (y) => y ? v.getPanelUrl(y) : null), re = () => {
|
|
2873
2874
|
L(), v.destroy();
|
|
@@ -2883,7 +2884,7 @@ function cr(Me = {}) {
|
|
|
2883
2884
|
instance: v,
|
|
2884
2885
|
// Stores
|
|
2885
2886
|
artifacts: fe,
|
|
2886
|
-
activeArtifactId:
|
|
2887
|
+
activeArtifactId: F,
|
|
2887
2888
|
isPanelOpen: k,
|
|
2888
2889
|
viewMode: i,
|
|
2889
2890
|
isFullscreen: s,
|