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/vue/index.js CHANGED
@@ -1,19 +1,19 @@
1
- import { ref as M, computed as b, createElementBlock as s, openBlock as a, normalizeClass as N, createElementVNode as e, toDisplayString as l, withModifiers as me, onMounted as $e, watch as de, Fragment as R, createCommentVNode as v, renderList as ve, createTextVNode as K, h as se, normalizeStyle as Pe, createStaticVNode as It, createBlock as xe, resolveDynamicComponent as Ft, nextTick as be, onUnmounted as De, Teleport as Vt, createVNode as Be, Transition as Ae, withCtx as He, withKeys as Rt, onBeforeUnmount as qt, unref as g, withDirectives as at, vShow as st, reactive as lt, provide as Ot, inject as Ut } from "vue";
2
- import { g as Se, f as nt, a as Oe, b as Ue, n as Dt, i as it, c as jt, D as Nt, d as ot } from "../index-llShix6s.js";
3
- import { J as Wt } from "../jszip.min-CdmYyw5L.js";
4
- const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class: "artifactuse-card__content" }, Kt = { class: "artifactuse-card__title" }, Yt = { class: "artifactuse-card__meta" }, Qt = { class: "artifactuse-card__type" }, Gt = { class: "artifactuse-card__size" }, ea = { class: "artifactuse-card__actions" }, ta = ["title"], aa = {
1
+ import { ref as M, computed as C, createElementBlock as s, openBlock as a, normalizeClass as N, createElementVNode as e, toDisplayString as n, withModifiers as he, onMounted as $e, watch as de, Fragment as R, createCommentVNode as v, renderList as ve, createTextVNode as K, h as se, normalizeStyle as Pe, createStaticVNode as qt, createBlock as xe, resolveDynamicComponent as Ot, nextTick as Ce, onUnmounted as Ne, Teleport as Ut, createVNode as Se, Transition as He, withCtx as Be, withKeys as Dt, onBeforeUnmount as jt, unref as g, withDirectives as it, vShow as lt, reactive as ot, provide as Nt, inject as Wt } from "vue";
2
+ import { g as Ee, f as rt, a as De, b as je, n as Jt, i as nt, c as Xt, D as Zt, d as ct } from "../index-INYOxlcg.js";
3
+ import { J as Kt } from "../jszip.min-CdmYyw5L.js";
4
+ const Yt = { class: "artifactuse-card__icon" }, Qt = ["innerHTML"], Gt = { class: "artifactuse-card__content" }, ea = { class: "artifactuse-card__title" }, ta = { class: "artifactuse-card__meta" }, aa = { class: "artifactuse-card__type" }, sa = { class: "artifactuse-card__size" }, ia = { class: "artifactuse-card__actions" }, la = ["title"], na = {
5
5
  key: 0,
6
6
  viewBox: "0 0 24 24",
7
7
  fill: "none",
8
8
  stroke: "currentColor",
9
9
  "stroke-width": "2"
10
- }, sa = {
10
+ }, oa = {
11
11
  key: 1,
12
12
  viewBox: "0 0 24 24",
13
13
  fill: "none",
14
14
  stroke: "currentColor",
15
15
  "stroke-width": "2"
16
- }, ia = {
16
+ }, ra = {
17
17
  __name: "ArtifactuseCard",
18
18
  props: {
19
19
  artifact: {
@@ -26,58 +26,58 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
26
26
  }
27
27
  },
28
28
  emits: ["open", "copy", "download"],
29
- setup(H, { emit: d }) {
30
- const _ = H, L = d, m = M(!1), r = b(() => Se(_.artifact.language)), V = b(() => {
29
+ setup(H, { emit: c }) {
30
+ const h = H, T = c, m = M(!1), o = C(() => Ee(h.artifact.language)), q = C(() => {
31
31
  var x;
32
- return nt(_.artifact.size || ((x = _.artifact.code) == null ? void 0 : x.length) || 0);
33
- }), S = b(() => Oe(_.artifact.language));
34
- function h(x) {
35
- x.stopPropagation(), L("open", _.artifact);
32
+ return rt(h.artifact.size || ((x = h.artifact.code) == null ? void 0 : x.length) || 0);
33
+ }), B = C(() => De(h.artifact.language));
34
+ function y(x) {
35
+ x.stopPropagation(), T("open", h.artifact);
36
36
  }
37
- async function n() {
37
+ async function l() {
38
38
  try {
39
- await navigator.clipboard.writeText(_.artifact.code), m.value = !0, setTimeout(() => {
39
+ await navigator.clipboard.writeText(h.artifact.code), m.value = !0, setTimeout(() => {
40
40
  m.value = !1;
41
- }, 2e3), L("copy", _.artifact);
41
+ }, 2e3), T("copy", h.artifact);
42
42
  } catch (x) {
43
43
  console.error("Failed to copy:", x);
44
44
  }
45
45
  }
46
- function p() {
46
+ function _() {
47
47
  var W;
48
- const x = new Blob([_.artifact.code], { type: "text/plain" }), F = URL.createObjectURL(x), $ = document.createElement("a"), j = Ue(_.artifact.language), q = ((W = _.artifact.title) == null ? void 0 : W.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
49
- $.href = F, $.download = `${q}.${j}`, document.body.appendChild($), $.click(), document.body.removeChild($), URL.revokeObjectURL(F), L("download", _.artifact);
48
+ const x = new Blob([h.artifact.code], { type: "text/plain" }), F = URL.createObjectURL(x), $ = document.createElement("a"), j = je(h.artifact.language), O = ((W = h.artifact.title) == null ? void 0 : W.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
49
+ $.href = F, $.download = `${O}.${j}`, document.body.appendChild($), $.click(), document.body.removeChild($), URL.revokeObjectURL(F), T("download", h.artifact);
50
50
  }
51
51
  return (x, F) => (a(), s("div", {
52
52
  class: N(["artifactuse-card", { "artifactuse-card--active": H.isActive }]),
53
- onClick: h
53
+ onClick: y
54
54
  }, [
55
- e("div", Jt, [
55
+ e("div", Yt, [
56
56
  (a(), s("svg", {
57
57
  viewBox: "0 0 24 24",
58
58
  fill: "none",
59
59
  stroke: "currentColor",
60
60
  "stroke-width": "1.5",
61
- innerHTML: S.value
62
- }, null, 8, Xt))
61
+ innerHTML: B.value
62
+ }, null, 8, Qt))
63
63
  ]),
64
- e("div", Zt, [
65
- e("div", Kt, l(H.artifact.title), 1),
66
- e("div", Yt, [
67
- e("span", Qt, l(r.value), 1),
64
+ e("div", Gt, [
65
+ e("div", ea, n(H.artifact.title), 1),
66
+ e("div", ta, [
67
+ e("span", aa, n(o.value), 1),
68
68
  F[0] || (F[0] = e("span", { class: "artifactuse-card__separator" }, "•", -1)),
69
- e("span", Gt, l(V.value), 1)
69
+ e("span", sa, n(q.value), 1)
70
70
  ])
71
71
  ]),
72
- e("div", ea, [
72
+ e("div", ia, [
73
73
  e("button", {
74
74
  class: "artifactuse-card__action",
75
- onClick: me(n, ["stop"]),
75
+ onClick: he(l, ["stop"]),
76
76
  title: m.value ? "Copied!" : "Copy code"
77
77
  }, [
78
- m.value ? (a(), s("svg", sa, [...F[2] || (F[2] = [
78
+ m.value ? (a(), s("svg", oa, [...F[2] || (F[2] = [
79
79
  e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
80
- ])])) : (a(), s("svg", aa, [...F[1] || (F[1] = [
80
+ ])])) : (a(), s("svg", na, [...F[1] || (F[1] = [
81
81
  e("rect", {
82
82
  x: "9",
83
83
  y: "9",
@@ -88,10 +88,10 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
88
88
  }, null, -1),
89
89
  e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
90
90
  ])]))
91
- ], 8, ta),
91
+ ], 8, la),
92
92
  e("button", {
93
93
  class: "artifactuse-card__action",
94
- onClick: me(p, ["stop"]),
94
+ onClick: he(_, ["stop"]),
95
95
  title: "Download file"
96
96
  }, [...F[3] || (F[3] = [
97
97
  e("svg", {
@@ -123,10 +123,10 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
123
123
  ], -1))
124
124
  ], 2));
125
125
  }
126
- }, la = ["data-artifactuse-theme"], na = {
126
+ }, ca = ["data-artifactuse-theme"], ua = {
127
127
  key: 0,
128
128
  class: "artifactuse-form-collapsed"
129
- }, oa = { class: "artifactuse-form-collapsed-icon" }, ra = {
129
+ }, da = { class: "artifactuse-form-collapsed-icon" }, va = {
130
130
  key: 0,
131
131
  viewBox: "0 0 24 24",
132
132
  fill: "none",
@@ -134,7 +134,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
134
134
  "stroke-width": "2.5",
135
135
  "stroke-linecap": "round",
136
136
  "stroke-linejoin": "round"
137
- }, ca = {
137
+ }, fa = {
138
138
  key: 1,
139
139
  viewBox: "0 0 24 24",
140
140
  fill: "none",
@@ -142,7 +142,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
142
142
  "stroke-width": "2.5",
143
143
  "stroke-linecap": "round",
144
144
  "stroke-linejoin": "round"
145
- }, ua = {
145
+ }, pa = {
146
146
  key: 2,
147
147
  viewBox: "0 0 24 24",
148
148
  fill: "none",
@@ -150,64 +150,64 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
150
150
  "stroke-width": "2.5",
151
151
  "stroke-linecap": "round",
152
152
  "stroke-linejoin": "round"
153
- }, da = { class: "artifactuse-form-collapsed-title" }, va = {
153
+ }, _a = { class: "artifactuse-form-collapsed-title" }, ha = {
154
154
  key: 0,
155
155
  class: "artifactuse-form-header"
156
- }, fa = {
156
+ }, ma = {
157
157
  key: 0,
158
158
  class: "artifactuse-form-title"
159
- }, pa = {
159
+ }, ya = {
160
160
  key: 1,
161
161
  class: "artifactuse-form-description"
162
- }, ha = {
162
+ }, ga = {
163
163
  key: 1,
164
164
  class: "artifactuse-form-buttons"
165
- }, _a = ["disabled", "onClick"], ma = ["innerHTML"], ya = { class: "artifactuse-form-fields" }, ga = {
165
+ }, ka = ["disabled", "onClick"], wa = ["innerHTML"], ba = { class: "artifactuse-form-fields" }, Ca = {
166
166
  key: 0,
167
167
  class: "artifactuse-form-buttons"
168
- }, ka = ["type", "disabled", "onClick"], wa = {
168
+ }, xa = ["type", "disabled", "onClick"], $a = {
169
169
  key: 0,
170
170
  class: "artifactuse-form-btn-spinner"
171
- }, Ca = ["innerHTML"], ba = {
171
+ }, Ma = ["innerHTML"], Ta = {
172
172
  key: 1,
173
173
  class: "artifactuse-form-divider"
174
- }, xa = {
174
+ }, La = {
175
175
  key: 2,
176
176
  class: "artifactuse-form-heading"
177
- }, $a = {
177
+ }, Aa = {
178
178
  key: 3,
179
179
  class: "artifactuse-form-field"
180
- }, Ma = { class: "artifactuse-checkbox-label" }, La = ["checked", "disabled", "onChange"], Ta = { class: "artifactuse-checkbox-text" }, Pa = {
180
+ }, Pa = { class: "artifactuse-checkbox-label" }, Ha = ["checked", "disabled", "onChange"], Ba = { class: "artifactuse-checkbox-text" }, Ea = {
181
181
  key: 0,
182
182
  class: "artifactuse-required"
183
- }, Aa = {
183
+ }, Sa = {
184
184
  key: 0,
185
185
  class: "artifactuse-help-text"
186
- }, Ha = {
186
+ }, za = {
187
187
  key: 1,
188
188
  class: "artifactuse-error-text"
189
- }, Sa = {
189
+ }, Ia = {
190
190
  key: 4,
191
191
  class: "artifactuse-form-field"
192
- }, Ba = ["for"], Ea = {
192
+ }, Fa = ["for"], Va = {
193
193
  key: 0,
194
194
  class: "artifactuse-required"
195
- }, za = ["id", "type", "value", "placeholder", "disabled", "required", "onInput"], Ia = ["id", "value", "placeholder", "disabled", "required", "rows", "onInput"], Fa = ["id", "value", "disabled", "required", "onChange"], Va = { value: "" }, Ra = ["value", "disabled"], qa = {
195
+ }, Ra = ["id", "type", "value", "placeholder", "disabled", "required", "onInput"], qa = ["id", "value", "placeholder", "disabled", "required", "rows", "onInput"], Oa = ["id", "value", "disabled", "required", "onChange"], Ua = { value: "" }, Da = ["value", "disabled"], ja = {
196
196
  key: 3,
197
197
  class: "artifactuse-radio-group"
198
- }, Oa = ["name", "value", "checked", "disabled", "onChange"], Ua = {
198
+ }, Na = ["name", "value", "checked", "disabled", "onChange"], Wa = {
199
199
  key: 4,
200
200
  class: "artifactuse-help-text"
201
- }, Da = {
201
+ }, Ja = {
202
202
  key: 5,
203
203
  class: "artifactuse-error-text"
204
- }, ja = {
204
+ }, Xa = {
205
205
  key: 0,
206
206
  class: "artifactuse-form-buttons artifactuse-form-buttons-default"
207
- }, Na = ["disabled"], Wa = {
207
+ }, Za = ["disabled"], Ka = {
208
208
  key: 0,
209
209
  class: "artifactuse-form-btn-spinner"
210
- }, Ja = {
210
+ }, Ya = {
211
211
  __name: "ArtifactuseInlineForm",
212
212
  props: {
213
213
  artifact: { type: Object, required: !0 },
@@ -220,133 +220,133 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
220
220
  }
221
221
  },
222
222
  emits: ["submit", "cancel", "reset", "button-click"],
223
- setup(H, { emit: d }) {
224
- const _ = H, L = d, m = M(_.initialState), r = b(() => m.value !== "active"), V = b(() => m.value === "active" ? "" : `artifactuse-form--${m.value}`);
225
- function S(w) {
223
+ setup(H, { emit: c }) {
224
+ const h = H, T = c, m = M(h.initialState), o = C(() => m.value !== "active"), q = C(() => m.value === "active" ? "" : `artifactuse-form--${m.value}`);
225
+ function B(w) {
226
226
  m.value = w;
227
227
  }
228
- const h = b(() => {
228
+ const y = C(() => {
229
229
  try {
230
- return JSON.parse(_.artifact.code);
230
+ return JSON.parse(h.artifact.code);
231
231
  } catch {
232
232
  return { title: "Invalid Form", variant: "fields", data: { fields: [] } };
233
233
  }
234
- }), n = M(null), p = b(() => _.artifact.id || h.value.id || `form-${Date.now()}`), x = b(() => `artifactuse-form-${h.value.variant || "fields"}`), F = b(() => h.value.title || "Form"), $ = M({}), j = M({}), q = M(!1), W = b(() => {
234
+ }), l = M(null), _ = C(() => h.artifact.id || y.value.id || `form-${Date.now()}`), x = C(() => `artifactuse-form-${y.value.variant || "fields"}`), F = C(() => y.value.title || "Form"), $ = M({}), j = M({}), O = M(!1), W = C(() => {
235
235
  var w;
236
- return ((w = h.value.data) == null ? void 0 : w.fields) || [];
237
- }), Y = b(() => {
236
+ return ((w = y.value.data) == null ? void 0 : w.fields) || [];
237
+ }), Y = C(() => {
238
238
  var w;
239
- return h.value.variant === "buttons" ? ((w = h.value.data) == null ? void 0 : w.fields) || [] : [];
240
- }), E = b(() => W.value.some((w) => w.type === "buttons"));
239
+ return y.value.variant === "buttons" ? ((w = y.value.data) == null ? void 0 : w.fields) || [] : [];
240
+ }), S = C(() => W.value.some((w) => w.type === "buttons"));
241
241
  function ie(w) {
242
242
  if (!w) return null;
243
- const T = w.trim();
244
- if (T.startsWith("#")) {
245
- let c = T.slice(1);
246
- if (c.length === 3 && (c = c.split("").map((z) => z + z).join("")), c.length === 6) {
247
- const z = parseInt(c.slice(0, 2), 16), le = parseInt(c.slice(2, 4), 16), pe = parseInt(c.slice(4, 6), 16);
243
+ const L = w.trim();
244
+ if (L.startsWith("#")) {
245
+ let u = L.slice(1);
246
+ if (u.length === 3 && (u = u.split("").map((z) => z + z).join("")), u.length === 6) {
247
+ const z = parseInt(u.slice(0, 2), 16), le = parseInt(u.slice(2, 4), 16), pe = parseInt(u.slice(4, 6), 16);
248
248
  if (!isNaN(z) && !isNaN(le) && !isNaN(pe)) return `${z}, ${le}, ${pe}`;
249
249
  }
250
250
  }
251
- const o = T.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
252
- if (o) return `${o[1]}, ${o[2]}, ${o[3]}`;
253
- const B = T.split(/[\s,]+/).map(Number).filter((c) => !isNaN(c));
254
- return B.length >= 3 ? `${B[0]}, ${B[1]}, ${B[2]}` : null;
255
- }
256
- function X() {
257
- if (n.value && _.accent) {
258
- const w = ie(_.accent);
259
- w && n.value.style.setProperty("--artifactuse-primary", w);
251
+ const r = L.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
252
+ if (r) return `${r[1]}, ${r[2]}, ${r[3]}`;
253
+ const E = L.split(/[\s,]+/).map(Number).filter((u) => !isNaN(u));
254
+ return E.length >= 3 ? `${E[0]}, ${E[1]}, ${E[2]}` : null;
255
+ }
256
+ function Z() {
257
+ if (l.value && h.accent) {
258
+ const w = ie(h.accent);
259
+ w && l.value.style.setProperty("--artifactuse-primary", w);
260
260
  }
261
261
  }
262
262
  $e(() => {
263
- X(), m.value = _.initialState;
264
- }), de(() => _.accent, X), de(() => _.initialState, (w) => {
263
+ Z(), m.value = h.initialState;
264
+ }), de(() => h.accent, Z), de(() => h.initialState, (w) => {
265
265
  m.value = w;
266
266
  });
267
- function J() {
268
- var o;
267
+ function X() {
268
+ var r;
269
269
  const w = {};
270
- W.value.forEach((B) => {
271
- ["buttons", "divider", "heading"].includes(B.type) || (B.defaultValue !== void 0 ? w[B.name] = B.defaultValue : B.type === "checkbox" ? w[B.name] = !1 : w[B.name] = "");
272
- }), (o = h.value.data) != null && o.defaults && Object.assign(w, h.value.data.defaults), $.value = w;
270
+ W.value.forEach((E) => {
271
+ ["buttons", "divider", "heading"].includes(E.type) || (E.defaultValue !== void 0 ? w[E.name] = E.defaultValue : E.type === "checkbox" ? w[E.name] = !1 : w[E.name] = "");
272
+ }), (r = y.value.data) != null && r.defaults && Object.assign(w, y.value.data.defaults), $.value = w;
273
273
  }
274
- J(), de(() => _.artifact.code, J);
274
+ X(), de(() => h.artifact.code, X);
275
275
  function oe(w) {
276
276
  return ["text", "email", "password", "tel", "url", "number", "date", "time", "datetime-local"].includes(w);
277
277
  }
278
- function f(w) {
279
- return w ? w.map((T) => typeof T == "string" ? { label: T, value: T } : T) : [];
278
+ function p(w) {
279
+ return w ? w.map((L) => typeof L == "string" ? { label: L, value: L } : L) : [];
280
280
  }
281
- function k(w, T) {
282
- $.value[w] = T, j.value[w] && delete j.value[w];
281
+ function k(w, L) {
282
+ $.value[w] = L, j.value[w] && delete j.value[w];
283
283
  }
284
284
  function ee() {
285
- var B;
285
+ var E;
286
286
  const w = {};
287
- W.value.forEach((c) => {
288
- if (["buttons", "divider", "heading"].includes(c.type)) return;
289
- const z = $.value[c.name];
290
- if (c.required && !z && z !== 0 && z !== !1) {
291
- w[c.name] = `${c.label || "This field"} is required`;
287
+ W.value.forEach((u) => {
288
+ if (["buttons", "divider", "heading"].includes(u.type)) return;
289
+ const z = $.value[u.name];
290
+ if (u.required && !z && z !== 0 && z !== !1) {
291
+ w[u.name] = `${u.label || "This field"} is required`;
292
292
  return;
293
293
  }
294
- if (c.pattern && z && !new RegExp(c.pattern).test(z)) {
295
- w[c.name] = c.patternMessage || `${c.label || "This field"} is invalid`;
294
+ if (u.pattern && z && !new RegExp(u.pattern).test(z)) {
295
+ w[u.name] = u.patternMessage || `${u.label || "This field"} is invalid`;
296
296
  return;
297
297
  }
298
- if (c.type === "email" && z && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(z)) {
299
- w[c.name] = "Please enter a valid email address";
298
+ if (u.type === "email" && z && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(z)) {
299
+ w[u.name] = "Please enter a valid email address";
300
300
  return;
301
301
  }
302
- if (c.minLength && z && z.length < c.minLength) {
303
- w[c.name] = `Minimum ${c.minLength} characters required`;
302
+ if (u.minLength && z && z.length < u.minLength) {
303
+ w[u.name] = `Minimum ${u.minLength} characters required`;
304
304
  return;
305
305
  }
306
- if (c.maxLength && z && z.length > c.maxLength) {
307
- w[c.name] = `Maximum ${c.maxLength} characters allowed`;
306
+ if (u.maxLength && z && z.length > u.maxLength) {
307
+ w[u.name] = `Maximum ${u.maxLength} characters allowed`;
308
308
  return;
309
309
  }
310
310
  });
311
- const o = (B = h.value.data) == null ? void 0 : B.validation;
312
- return o && Object.entries(o).forEach(([c, z]) => {
313
- if (w[c]) return;
314
- const le = $.value[c];
315
- z.pattern && le && (new RegExp(z.pattern).test(le) || (w[c] = z.message || `${c} is invalid`));
311
+ const r = (E = y.value.data) == null ? void 0 : E.validation;
312
+ return r && Object.entries(r).forEach(([u, z]) => {
313
+ if (w[u]) return;
314
+ const le = $.value[u];
315
+ z.pattern && le && (new RegExp(z.pattern).test(le) || (w[u] = z.message || `${u} is invalid`));
316
316
  }), j.value = w, Object.keys(w).length === 0;
317
317
  }
318
318
  function re() {
319
- J(), j.value = {};
319
+ X(), j.value = {};
320
320
  }
321
- function P() {
322
- ee() && (q.value = !0, L("submit", {
323
- formId: p.value,
321
+ function A() {
322
+ ee() && (O.value = !0, T("submit", {
323
+ formId: _.value,
324
324
  action: "submit",
325
325
  values: { ...$.value },
326
326
  timestamp: Date.now()
327
327
  }), setTimeout(() => {
328
- q.value = !1, S("submitted");
328
+ O.value = !1, B("submitted");
329
329
  }, 300));
330
330
  }
331
331
  function Q(w) {
332
- const T = w.action || "custom";
333
- switch (T) {
332
+ const L = w.action || "custom";
333
+ switch (L) {
334
334
  case "submit":
335
- P();
335
+ A();
336
336
  break;
337
337
  case "cancel":
338
- L("cancel", {
339
- formId: p.value,
338
+ T("cancel", {
339
+ formId: _.value,
340
340
  action: "cancel",
341
341
  buttonName: w.name || "cancel",
342
342
  timestamp: Date.now()
343
343
  }), setTimeout(() => {
344
- S("cancelled");
344
+ B("cancelled");
345
345
  }, 150);
346
346
  break;
347
347
  case "reset":
348
- re(), L("reset", {
349
- formId: p.value,
348
+ re(), T("reset", {
349
+ formId: _.value,
350
350
  action: "reset",
351
351
  buttonName: w.name || "reset",
352
352
  timestamp: Date.now()
@@ -354,34 +354,34 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
354
354
  break;
355
355
  case "custom":
356
356
  default:
357
- L("button-click", {
358
- formId: p.value,
359
- action: T,
357
+ T("button-click", {
358
+ formId: _.value,
359
+ action: L,
360
360
  buttonName: w.name || w.label,
361
361
  buttonLabel: w.label,
362
362
  values: { ...$.value },
363
363
  timestamp: Date.now()
364
364
  }), setTimeout(() => {
365
- S("submitted");
365
+ B("submitted");
366
366
  }, 150);
367
367
  break;
368
368
  }
369
369
  }
370
- return (w, T) => (a(), s("div", {
370
+ return (w, L) => (a(), s("div", {
371
371
  ref_key: "containerRef",
372
- ref: n,
372
+ ref: l,
373
373
  class: N([
374
374
  "artifactuse-inline-form",
375
375
  x.value,
376
- V.value
376
+ q.value
377
377
  ]),
378
378
  "data-artifactuse-theme": H.theme
379
379
  }, [
380
- r.value ? (a(), s("div", na, [
381
- e("div", oa, [
382
- m.value === "submitted" ? (a(), s("svg", ra, [...T[1] || (T[1] = [
380
+ o.value ? (a(), s("div", ua, [
381
+ e("div", da, [
382
+ m.value === "submitted" ? (a(), s("svg", va, [...L[1] || (L[1] = [
383
383
  e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
384
- ])])) : m.value === "cancelled" ? (a(), s("svg", ca, [...T[2] || (T[2] = [
384
+ ])])) : m.value === "cancelled" ? (a(), s("svg", fa, [...L[2] || (L[2] = [
385
385
  e("line", {
386
386
  x1: "18",
387
387
  y1: "6",
@@ -394,7 +394,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
394
394
  x2: "18",
395
395
  y2: "18"
396
396
  }, null, -1)
397
- ])])) : (a(), s("svg", ua, [...T[3] || (T[3] = [
397
+ ])])) : (a(), s("svg", pa, [...L[3] || (L[3] = [
398
398
  e("line", {
399
399
  x1: "5",
400
400
  y1: "12",
@@ -403,216 +403,216 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
403
403
  }, null, -1)
404
404
  ])]))
405
405
  ]),
406
- e("span", da, l(F.value), 1)
406
+ e("span", _a, n(F.value), 1)
407
407
  ])) : (a(), s(R, { key: 1 }, [
408
- h.value.title || h.value.description ? (a(), s("div", va, [
409
- h.value.title ? (a(), s("div", fa, l(h.value.title), 1)) : v("", !0),
410
- h.value.description ? (a(), s("p", pa, l(h.value.description), 1)) : v("", !0)
408
+ y.value.title || y.value.description ? (a(), s("div", ha, [
409
+ y.value.title ? (a(), s("div", ma, n(y.value.title), 1)) : v("", !0),
410
+ y.value.description ? (a(), s("p", ya, n(y.value.description), 1)) : v("", !0)
411
411
  ])) : v("", !0),
412
- h.value.variant === "buttons" ? (a(), s("div", ha, [
413
- (a(!0), s(R, null, ve(Y.value, (o) => (a(), s("button", {
414
- key: o.name || o.label,
412
+ y.value.variant === "buttons" ? (a(), s("div", ga, [
413
+ (a(!0), s(R, null, ve(Y.value, (r) => (a(), s("button", {
414
+ key: r.name || r.label,
415
415
  type: "button",
416
- class: N(["artifactuse-form-btn", `artifactuse-form-btn-${o.variant || "secondary"}`]),
417
- disabled: o.disabled || q.value,
418
- onClick: (B) => Q(o)
416
+ class: N(["artifactuse-form-btn", `artifactuse-form-btn-${r.variant || "secondary"}`]),
417
+ disabled: r.disabled || O.value,
418
+ onClick: (E) => Q(r)
419
419
  }, [
420
- o.icon ? (a(), s("span", {
420
+ r.icon ? (a(), s("span", {
421
421
  key: 0,
422
422
  class: "artifactuse-form-btn-icon",
423
- innerHTML: o.icon
424
- }, null, 8, ma)) : v("", !0),
425
- K(" " + l(o.label), 1)
426
- ], 10, _a))), 128))
423
+ innerHTML: r.icon
424
+ }, null, 8, wa)) : v("", !0),
425
+ K(" " + n(r.label), 1)
426
+ ], 10, ka))), 128))
427
427
  ])) : (a(), s("form", {
428
428
  key: 2,
429
429
  class: "artifactuse-form",
430
- onSubmit: me(P, ["prevent"])
430
+ onSubmit: he(A, ["prevent"])
431
431
  }, [
432
- e("div", ya, [
433
- (a(!0), s(R, null, ve(W.value, (o, B) => (a(), s(R, {
434
- key: o.name || B
432
+ e("div", ba, [
433
+ (a(!0), s(R, null, ve(W.value, (r, E) => (a(), s(R, {
434
+ key: r.name || E
435
435
  }, [
436
- o.type === "buttons" ? (a(), s("div", ga, [
437
- (a(!0), s(R, null, ve(o.fields || [], (c) => (a(), s("button", {
438
- key: c.name || c.label,
439
- type: c.action === "submit" ? "submit" : "button",
440
- class: N(["artifactuse-form-btn", `artifactuse-form-btn-${c.variant || "secondary"}`]),
441
- disabled: c.disabled || c.action === "submit" && q.value,
442
- onClick: (z) => c.action !== "submit" ? Q(c) : null
436
+ r.type === "buttons" ? (a(), s("div", Ca, [
437
+ (a(!0), s(R, null, ve(r.fields || [], (u) => (a(), s("button", {
438
+ key: u.name || u.label,
439
+ type: u.action === "submit" ? "submit" : "button",
440
+ class: N(["artifactuse-form-btn", `artifactuse-form-btn-${u.variant || "secondary"}`]),
441
+ disabled: u.disabled || u.action === "submit" && O.value,
442
+ onClick: (z) => u.action !== "submit" ? Q(u) : null
443
443
  }, [
444
- q.value && c.action === "submit" ? (a(), s("span", wa)) : c.icon ? (a(), s("span", {
444
+ O.value && u.action === "submit" ? (a(), s("span", $a)) : u.icon ? (a(), s("span", {
445
445
  key: 1,
446
446
  class: "artifactuse-form-btn-icon",
447
- innerHTML: c.icon
448
- }, null, 8, Ca)) : v("", !0),
449
- K(" " + l(q.value && c.action === "submit" ? "Submitting..." : c.label), 1)
450
- ], 10, ka))), 128))
451
- ])) : o.type === "divider" ? (a(), s("div", ba)) : o.type === "heading" ? (a(), s("div", xa, l(o.label), 1)) : o.type === "checkbox" ? (a(), s("div", $a, [
452
- e("label", Ma, [
447
+ innerHTML: u.icon
448
+ }, null, 8, Ma)) : v("", !0),
449
+ K(" " + n(O.value && u.action === "submit" ? "Submitting..." : u.label), 1)
450
+ ], 10, xa))), 128))
451
+ ])) : r.type === "divider" ? (a(), s("div", Ta)) : r.type === "heading" ? (a(), s("div", La, n(r.label), 1)) : r.type === "checkbox" ? (a(), s("div", Aa, [
452
+ e("label", Pa, [
453
453
  e("input", {
454
454
  type: "checkbox",
455
- checked: $.value[o.name],
456
- disabled: o.disabled,
455
+ checked: $.value[r.name],
456
+ disabled: r.disabled,
457
457
  class: "artifactuse-checkbox",
458
- onChange: (c) => k(o.name, c.target.checked)
459
- }, null, 40, La),
460
- e("span", Ta, [
461
- K(l(o.label) + " ", 1),
462
- o.required ? (a(), s("span", Pa, "*")) : v("", !0)
458
+ onChange: (u) => k(r.name, u.target.checked)
459
+ }, null, 40, Ha),
460
+ e("span", Ba, [
461
+ K(n(r.label) + " ", 1),
462
+ r.required ? (a(), s("span", Ea, "*")) : v("", !0)
463
463
  ])
464
464
  ]),
465
- o.helpText ? (a(), s("span", Aa, l(o.helpText), 1)) : v("", !0),
466
- j.value[o.name] ? (a(), s("span", Ha, l(j.value[o.name]), 1)) : v("", !0)
467
- ])) : (a(), s("div", Sa, [
465
+ r.helpText ? (a(), s("span", Sa, n(r.helpText), 1)) : v("", !0),
466
+ j.value[r.name] ? (a(), s("span", za, n(j.value[r.name]), 1)) : v("", !0)
467
+ ])) : (a(), s("div", Ia, [
468
468
  e("label", {
469
- for: `${p.value}-${o.name}`,
469
+ for: `${_.value}-${r.name}`,
470
470
  class: "artifactuse-label"
471
471
  }, [
472
- K(l(o.label) + " ", 1),
473
- o.required ? (a(), s("span", Ea, "*")) : v("", !0)
474
- ], 8, Ba),
475
- oe(o.type) ? (a(), s("input", {
472
+ K(n(r.label) + " ", 1),
473
+ r.required ? (a(), s("span", Va, "*")) : v("", !0)
474
+ ], 8, Fa),
475
+ oe(r.type) ? (a(), s("input", {
476
476
  key: 0,
477
- id: `${p.value}-${o.name}`,
478
- type: o.type,
479
- value: $.value[o.name],
480
- placeholder: o.placeholder,
481
- disabled: o.disabled,
482
- required: o.required,
477
+ id: `${_.value}-${r.name}`,
478
+ type: r.type,
479
+ value: $.value[r.name],
480
+ placeholder: r.placeholder,
481
+ disabled: r.disabled,
482
+ required: r.required,
483
483
  class: "artifactuse-input",
484
- onInput: (c) => k(o.name, c.target.value)
485
- }, null, 40, za)) : o.type === "textarea" ? (a(), s("textarea", {
484
+ onInput: (u) => k(r.name, u.target.value)
485
+ }, null, 40, Ra)) : r.type === "textarea" ? (a(), s("textarea", {
486
486
  key: 1,
487
- id: `${p.value}-${o.name}`,
488
- value: $.value[o.name],
489
- placeholder: o.placeholder,
490
- disabled: o.disabled,
491
- required: o.required,
492
- rows: o.rows || 3,
487
+ id: `${_.value}-${r.name}`,
488
+ value: $.value[r.name],
489
+ placeholder: r.placeholder,
490
+ disabled: r.disabled,
491
+ required: r.required,
492
+ rows: r.rows || 3,
493
493
  class: "artifactuse-textarea",
494
- onInput: (c) => k(o.name, c.target.value)
495
- }, null, 40, Ia)) : o.type === "select" ? (a(), s("select", {
494
+ onInput: (u) => k(r.name, u.target.value)
495
+ }, null, 40, qa)) : r.type === "select" ? (a(), s("select", {
496
496
  key: 2,
497
- id: `${p.value}-${o.name}`,
498
- value: $.value[o.name],
499
- disabled: o.disabled,
500
- required: o.required,
497
+ id: `${_.value}-${r.name}`,
498
+ value: $.value[r.name],
499
+ disabled: r.disabled,
500
+ required: r.required,
501
501
  class: "artifactuse-select",
502
- onChange: (c) => k(o.name, c.target.value)
502
+ onChange: (u) => k(r.name, u.target.value)
503
503
  }, [
504
- e("option", Va, l(o.placeholder || "Select..."), 1),
505
- (a(!0), s(R, null, ve(f(o.options), (c) => (a(), s("option", {
506
- key: c.value,
507
- value: c.value,
508
- disabled: c.disabled
509
- }, l(c.label), 9, Ra))), 128))
510
- ], 40, Fa)) : o.type === "radio" ? (a(), s("div", qa, [
511
- (a(!0), s(R, null, ve(f(o.options), (c) => (a(), s("label", {
512
- key: c.value,
504
+ e("option", Ua, n(r.placeholder || "Select..."), 1),
505
+ (a(!0), s(R, null, ve(p(r.options), (u) => (a(), s("option", {
506
+ key: u.value,
507
+ value: u.value,
508
+ disabled: u.disabled
509
+ }, n(u.label), 9, Da))), 128))
510
+ ], 40, Oa)) : r.type === "radio" ? (a(), s("div", ja, [
511
+ (a(!0), s(R, null, ve(p(r.options), (u) => (a(), s("label", {
512
+ key: u.value,
513
513
  class: "artifactuse-radio-label"
514
514
  }, [
515
515
  e("input", {
516
516
  type: "radio",
517
- name: o.name,
518
- value: c.value,
519
- checked: $.value[o.name] === c.value,
520
- disabled: c.disabled || o.disabled,
517
+ name: r.name,
518
+ value: u.value,
519
+ checked: $.value[r.name] === u.value,
520
+ disabled: u.disabled || r.disabled,
521
521
  class: "artifactuse-radio",
522
- onChange: (z) => k(o.name, c.value)
523
- }, null, 40, Oa),
524
- e("span", null, l(c.label), 1)
522
+ onChange: (z) => k(r.name, u.value)
523
+ }, null, 40, Na),
524
+ e("span", null, n(u.label), 1)
525
525
  ]))), 128))
526
526
  ])) : v("", !0),
527
- o.helpText ? (a(), s("span", Ua, l(o.helpText), 1)) : v("", !0),
528
- j.value[o.name] ? (a(), s("span", Da, l(j.value[o.name]), 1)) : v("", !0)
527
+ r.helpText ? (a(), s("span", Wa, n(r.helpText), 1)) : v("", !0),
528
+ j.value[r.name] ? (a(), s("span", Ja, n(j.value[r.name]), 1)) : v("", !0)
529
529
  ]))
530
530
  ], 64))), 128))
531
531
  ]),
532
- E.value ? v("", !0) : (a(), s("div", ja, [
532
+ S.value ? v("", !0) : (a(), s("div", Xa, [
533
533
  e("button", {
534
534
  type: "button",
535
535
  class: "artifactuse-form-btn artifactuse-form-btn-ghost",
536
- onClick: T[0] || (T[0] = (o) => Q({ action: "cancel", label: "Cancel" }))
536
+ onClick: L[0] || (L[0] = (r) => Q({ action: "cancel", label: "Cancel" }))
537
537
  }, " Cancel "),
538
538
  e("button", {
539
539
  type: "submit",
540
540
  class: "artifactuse-form-btn artifactuse-form-btn-primary",
541
- disabled: q.value
541
+ disabled: O.value
542
542
  }, [
543
- q.value ? (a(), s("span", Wa)) : v("", !0),
544
- K(" " + l(q.value ? "Submitting..." : "Submit"), 1)
545
- ], 8, Na)
543
+ O.value ? (a(), s("span", Ka)) : v("", !0),
544
+ K(" " + n(O.value ? "Submitting..." : "Submit"), 1)
545
+ ], 8, Za)
546
546
  ]))
547
547
  ], 32))
548
548
  ], 64))
549
- ], 10, la));
549
+ ], 10, ca));
550
550
  }
551
- }, Xa = ["data-artifactuse-theme"], Za = { class: "artifactuse-social-header" }, Ka = ["src", "alt"], Ya = { class: "artifactuse-social-author" }, Qa = { class: "artifactuse-social-author-name" }, Ga = { class: "artifactuse-social-author-meta" }, es = { class: "artifactuse-social-author-handle" }, ts = { class: "artifactuse-social-timestamp" }, as = { class: "artifactuse-social-content" }, ss = ["innerHTML"], is = {
551
+ }, Qa = ["data-artifactuse-theme"], Ga = { class: "artifactuse-social-header" }, es = ["src", "alt"], ts = { class: "artifactuse-social-author" }, as = { class: "artifactuse-social-author-name" }, ss = { class: "artifactuse-social-author-meta" }, is = { class: "artifactuse-social-author-handle" }, ls = { class: "artifactuse-social-timestamp" }, ns = { class: "artifactuse-social-content" }, os = ["innerHTML"], rs = {
552
552
  key: 0,
553
553
  class: "artifactuse-social-media"
554
- }, ls = ["data-count"], ns = ["src", "alt"], os = {
554
+ }, cs = ["data-count"], us = ["src", "alt"], ds = {
555
555
  key: 1,
556
556
  class: "artifactuse-social-link-card"
557
- }, rs = ["src", "alt"], cs = { class: "artifactuse-social-link-info" }, us = { class: "artifactuse-social-link-domain" }, ds = { class: "artifactuse-social-link-title" }, vs = {
557
+ }, vs = ["src", "alt"], fs = { class: "artifactuse-social-link-info" }, ps = { class: "artifactuse-social-link-domain" }, _s = { class: "artifactuse-social-link-title" }, hs = {
558
558
  key: 0,
559
559
  class: "artifactuse-social-link-description"
560
- }, fs = {
560
+ }, ms = {
561
561
  key: 2,
562
562
  class: "artifactuse-social-poll"
563
- }, ps = { class: "artifactuse-social-poll-label" }, hs = { class: "artifactuse-social-poll-label-percent" }, _s = { class: "artifactuse-social-poll-meta" }, ms = {
563
+ }, ys = { class: "artifactuse-social-poll-label" }, gs = { class: "artifactuse-social-poll-label-percent" }, ks = { class: "artifactuse-social-poll-meta" }, ws = {
564
564
  key: 3,
565
565
  class: "artifactuse-social-quote"
566
- }, ys = { class: "artifactuse-social-quote-header" }, gs = ["src"], ks = { class: "artifactuse-social-quote-author" }, ws = { class: "artifactuse-social-quote-handle" }, Cs = { class: "artifactuse-social-quote-text" }, bs = {
566
+ }, bs = { class: "artifactuse-social-quote-header" }, Cs = ["src"], xs = { class: "artifactuse-social-quote-author" }, $s = { class: "artifactuse-social-quote-handle" }, Ms = { class: "artifactuse-social-quote-text" }, Ts = {
567
567
  key: 0,
568
568
  class: "artifactuse-social-engagement"
569
- }, xs = { class: "artifactuse-social-stat" }, $s = { class: "artifactuse-social-stat" }, Ms = { class: "artifactuse-social-stat" }, Ls = { class: "artifactuse-social-stat" }, Ts = { class: "artifactuse-social-header" }, Ps = ["src", "alt"], As = { class: "artifactuse-social-author-info" }, Hs = { class: "artifactuse-social-author-name" }, Ss = {
569
+ }, Ls = { class: "artifactuse-social-stat" }, As = { class: "artifactuse-social-stat" }, Ps = { class: "artifactuse-social-stat" }, Hs = { class: "artifactuse-social-stat" }, Bs = { class: "artifactuse-social-header" }, Es = ["src", "alt"], Ss = { class: "artifactuse-social-author-info" }, zs = { class: "artifactuse-social-author-name" }, Is = {
570
570
  key: 0,
571
571
  class: "artifactuse-social-author-connection"
572
- }, Bs = { class: "artifactuse-social-author-headline" }, Es = { class: "artifactuse-social-timestamp" }, zs = { class: "artifactuse-social-content" }, Is = ["innerHTML"], Fs = {
572
+ }, Fs = { class: "artifactuse-social-author-headline" }, Vs = { class: "artifactuse-social-timestamp" }, Rs = { class: "artifactuse-social-content" }, qs = ["innerHTML"], Os = {
573
573
  key: 0,
574
574
  class: "artifactuse-social-link-card"
575
- }, Vs = ["src", "alt"], Rs = { class: "artifactuse-social-link-info" }, qs = { class: "artifactuse-social-link-title" }, Os = { class: "artifactuse-social-link-domain" }, Us = {
575
+ }, Us = ["src", "alt"], Ds = { class: "artifactuse-social-link-info" }, js = { class: "artifactuse-social-link-title" }, Ns = { class: "artifactuse-social-link-domain" }, Ws = {
576
576
  key: 0,
577
577
  class: "artifactuse-social-engagement"
578
- }, Ds = { class: "artifactuse-social-reactions" }, js = { class: "artifactuse-social-header" }, Ns = ["src", "alt"], Ws = { class: "artifactuse-social-author-name" }, Js = {
578
+ }, Js = { class: "artifactuse-social-reactions" }, Xs = { class: "artifactuse-social-header" }, Zs = ["src", "alt"], Ks = { class: "artifactuse-social-author-name" }, Ys = {
579
579
  key: 0,
580
580
  class: "artifactuse-social-verified",
581
581
  viewBox: "0 0 24 24",
582
582
  fill: "currentColor"
583
- }, Xs = {
583
+ }, Qs = {
584
584
  key: 0,
585
585
  class: "artifactuse-social-media"
586
- }, Zs = ["src", "alt"], Ks = { class: "artifactuse-social-likes" }, Ys = { class: "artifactuse-social-caption" }, Qs = { class: "artifactuse-social-caption-author" }, Gs = ["innerHTML"], ei = { class: "artifactuse-social-timestamp" }, ti = { class: "artifactuse-social-header" }, ai = ["src", "alt"], si = { class: "artifactuse-social-author-info" }, ii = { class: "artifactuse-social-author-name" }, li = { class: "artifactuse-social-timestamp" }, ni = { class: "artifactuse-social-content" }, oi = ["innerHTML"], ri = {
586
+ }, Gs = ["src", "alt"], ei = { class: "artifactuse-social-likes" }, ti = { class: "artifactuse-social-caption" }, ai = { class: "artifactuse-social-caption-author" }, si = ["innerHTML"], ii = { class: "artifactuse-social-timestamp" }, li = { class: "artifactuse-social-header" }, ni = ["src", "alt"], oi = { class: "artifactuse-social-author-info" }, ri = { class: "artifactuse-social-author-name" }, ci = { class: "artifactuse-social-timestamp" }, ui = { class: "artifactuse-social-content" }, di = ["innerHTML"], vi = {
587
587
  key: 0,
588
588
  class: "artifactuse-social-link-card"
589
- }, ci = ["src", "alt"], ui = { class: "artifactuse-social-link-info" }, di = { class: "artifactuse-social-link-domain" }, vi = { class: "artifactuse-social-link-title" }, fi = {
589
+ }, fi = ["src", "alt"], pi = { class: "artifactuse-social-link-info" }, _i = { class: "artifactuse-social-link-domain" }, hi = { class: "artifactuse-social-link-title" }, mi = {
590
590
  key: 0,
591
591
  class: "artifactuse-social-link-description"
592
- }, pi = {
592
+ }, yi = {
593
593
  key: 0,
594
594
  class: "artifactuse-social-engagement"
595
- }, hi = { class: "artifactuse-social-reactions" }, _i = { class: "artifactuse-social-reaction-count" }, mi = { class: "artifactuse-social-comments-shares" }, yi = { class: "artifactuse-social-header" }, gi = ["src", "alt"], ki = { class: "artifactuse-social-author-info" }, wi = { class: "artifactuse-social-author-name" }, Ci = {
595
+ }, gi = { class: "artifactuse-social-reactions" }, ki = { class: "artifactuse-social-reaction-count" }, wi = { class: "artifactuse-social-comments-shares" }, bi = { class: "artifactuse-social-header" }, Ci = ["src", "alt"], xi = { class: "artifactuse-social-author-info" }, $i = { class: "artifactuse-social-author-name" }, Mi = {
596
596
  key: 0,
597
597
  class: "artifactuse-social-verified",
598
598
  viewBox: "0 0 24 24",
599
599
  fill: "currentColor"
600
- }, bi = { class: "artifactuse-social-timestamp" }, xi = { class: "artifactuse-social-content" }, $i = ["innerHTML"], Mi = {
600
+ }, Ti = { class: "artifactuse-social-timestamp" }, Li = { class: "artifactuse-social-content" }, Ai = ["innerHTML"], Pi = {
601
601
  key: 0,
602
602
  class: "artifactuse-social-engagement"
603
- }, Li = { class: "artifactuse-social-stat" }, Ti = { class: "artifactuse-social-stat" }, Pi = { class: "artifactuse-social-stat" }, Ai = { class: "artifactuse-social-thumbnail" }, Hi = ["src", "alt"], Si = {
603
+ }, Hi = { class: "artifactuse-social-stat" }, Bi = { class: "artifactuse-social-stat" }, Ei = { class: "artifactuse-social-stat" }, Si = { class: "artifactuse-social-thumbnail" }, zi = ["src", "alt"], Ii = {
604
604
  key: 1,
605
605
  class: "artifactuse-social-duration"
606
- }, Bi = { class: "artifactuse-social-info" }, Ei = { class: "artifactuse-social-header" }, zi = ["src", "alt"], Ii = { class: "artifactuse-social-author-name" }, Fi = ["innerHTML"], Vi = {
606
+ }, Fi = { class: "artifactuse-social-info" }, Vi = { class: "artifactuse-social-header" }, Ri = ["src", "alt"], qi = { class: "artifactuse-social-author-name" }, Oi = ["innerHTML"], Ui = {
607
607
  key: 0,
608
608
  class: "artifactuse-social-sound"
609
- }, Ri = {
609
+ }, Di = {
610
610
  key: 1,
611
611
  class: "artifactuse-social-engagement"
612
- }, qi = { class: "artifactuse-social-thumbnail" }, Oi = ["src", "alt"], Ui = {
612
+ }, ji = { class: "artifactuse-social-thumbnail" }, Ni = ["src", "alt"], Wi = {
613
613
  key: 1,
614
614
  class: "artifactuse-social-duration"
615
- }, Di = { class: "artifactuse-social-info" }, ji = ["src", "alt"], Ni = { class: "artifactuse-social-title" }, Wi = { class: "artifactuse-social-channel" }, Ji = { class: "artifactuse-social-meta" }, Xi = { class: "artifactuse-social-actions-bar" }, Zi = { class: "artifactuse-social-platform-badge" }, he = '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>', Ki = {
615
+ }, Ji = { class: "artifactuse-social-info" }, Xi = ["src", "alt"], Zi = { class: "artifactuse-social-title" }, Ki = { class: "artifactuse-social-channel" }, Yi = { class: "artifactuse-social-meta" }, Qi = { class: "artifactuse-social-actions-bar" }, Gi = { class: "artifactuse-social-platform-badge" }, _e = '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>', el = {
616
616
  __name: "ArtifactuseSocialPreview",
617
617
  props: {
618
618
  artifact: {
@@ -625,37 +625,37 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
625
625
  }
626
626
  },
627
627
  emits: ["copy", "edit"],
628
- setup(H, { emit: d }) {
629
- const _ = H, L = d, m = M(null), r = M("Copy"), V = b(() => {
628
+ setup(H, { emit: c }) {
629
+ const h = H, T = c, m = M(null), o = M("Copy"), q = C(() => {
630
630
  try {
631
- return JSON.parse(_.artifact.code);
631
+ return JSON.parse(h.artifact.code);
632
632
  } catch {
633
633
  return { platform: "twitter", data: {} };
634
634
  }
635
- }), S = b(() => {
636
- var f;
637
- return ((f = V.value) == null ? void 0 : f.platform) || "twitter";
635
+ }), B = C(() => {
636
+ var p;
637
+ return ((p = q.value) == null ? void 0 : p.platform) || "twitter";
638
638
  });
639
- b(() => {
640
- var f;
641
- return ((f = V.value) == null ? void 0 : f.variant) || "post";
639
+ C(() => {
640
+ var p;
641
+ return ((p = q.value) == null ? void 0 : p.variant) || "post";
642
642
  });
643
- const h = b(() => {
644
- var f, k;
645
- return ((k = (f = V.value) == null ? void 0 : f.data) == null ? void 0 : k.author) || {};
646
- }), n = b(() => {
647
- var f, k;
648
- return ((k = (f = V.value) == null ? void 0 : f.data) == null ? void 0 : k.content) || {};
649
- }), p = b(() => {
650
- var f, k;
651
- return ((k = (f = V.value) == null ? void 0 : f.data) == null ? void 0 : k.engagement) || {};
652
- }), x = b(() => {
653
- var f, k;
654
- return ((k = (f = V.value) == null ? void 0 : f.data) == null ? void 0 : k.meta) || {};
655
- }), F = b(() => {
656
- const f = p.value;
657
- return f.likes || f.comments || f.shares || f.retweets || f.replies || f.views;
658
- }), $ = b(() => `artifactuse-social-verified-${h.value.verifiedType || "blue"}`), j = b(() => ({
643
+ const y = C(() => {
644
+ var p, k;
645
+ return ((k = (p = q.value) == null ? void 0 : p.data) == null ? void 0 : k.author) || {};
646
+ }), l = C(() => {
647
+ var p, k;
648
+ return ((k = (p = q.value) == null ? void 0 : p.data) == null ? void 0 : k.content) || {};
649
+ }), _ = C(() => {
650
+ var p, k;
651
+ return ((k = (p = q.value) == null ? void 0 : p.data) == null ? void 0 : k.engagement) || {};
652
+ }), x = C(() => {
653
+ var p, k;
654
+ return ((k = (p = q.value) == null ? void 0 : p.data) == null ? void 0 : k.meta) || {};
655
+ }), F = C(() => {
656
+ const p = _.value;
657
+ return p.likes || p.comments || p.shares || p.retweets || p.replies || p.views;
658
+ }), $ = C(() => `artifactuse-social-verified-${y.value.verifiedType || "blue"}`), j = C(() => ({
659
659
  twitter: "X",
660
660
  linkedin: "LinkedIn",
661
661
  instagram: "Instagram",
@@ -663,8 +663,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
663
663
  threads: "Threads",
664
664
  tiktok: "TikTok",
665
665
  youtube: "YouTube"
666
- })[S.value] || S.value), q = b(() => {
667
- const f = {
666
+ })[B.value] || B.value), O = C(() => {
667
+ const p = {
668
668
  twitter: () => se("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
669
669
  se("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" })
670
670
  ]),
@@ -687,61 +687,61 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
687
687
  se("path", { d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" })
688
688
  ])
689
689
  };
690
- return f[S.value] || f.twitter;
691
- }), W = b(() => {
692
- let f = n.value.text || "";
693
- return f = f.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), f = f.replace(/#(\w+)/g, '<span class="artifactuse-social-hashtag">#$1</span>'), f = f.replace(/@(\w+)/g, '<span class="artifactuse-social-mention">@$1</span>'), f = f.replace(
690
+ return p[B.value] || p.twitter;
691
+ }), W = C(() => {
692
+ let p = l.value.text || "";
693
+ return p = p.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), p = p.replace(/#(\w+)/g, '<span class="artifactuse-social-hashtag">#$1</span>'), p = p.replace(/@(\w+)/g, '<span class="artifactuse-social-mention">@$1</span>'), p = p.replace(
694
694
  /(https?:\/\/[^\s]+)/g,
695
695
  '<a href="$1" target="_blank" rel="noopener">$1</a>'
696
- ), f;
697
- }), Y = b(() => {
698
- const f = p.value.reactions || {};
699
- return Object.values(f).reduce((k, ee) => k + (ee || 0), 0) || p.value.likes || 0;
696
+ ), p;
697
+ }), Y = C(() => {
698
+ const p = _.value.reactions || {};
699
+ return Object.values(p).reduce((k, ee) => k + (ee || 0), 0) || _.value.likes || 0;
700
700
  });
701
- function E(f) {
702
- return f ? f >= 1e6 ? `${(f / 1e6).toFixed(1)}M` : f >= 1e3 ? `${(f / 1e3).toFixed(1)}K` : f.toString() : "0";
701
+ function S(p) {
702
+ return p ? p >= 1e6 ? `${(p / 1e6).toFixed(1)}M` : p >= 1e3 ? `${(p / 1e3).toFixed(1)}K` : p.toString() : "0";
703
703
  }
704
- function ie(f) {
704
+ function ie(p) {
705
705
  try {
706
- return new URL(f).hostname.replace("www.", "");
706
+ return new URL(p).hostname.replace("www.", "");
707
707
  } catch {
708
- return f;
708
+ return p;
709
709
  }
710
710
  }
711
- function X(f) {
712
- f.target.src = he;
711
+ function Z(p) {
712
+ p.target.src = _e;
713
713
  }
714
- function J(f) {
715
- f.target.style.display = "none";
714
+ function X(p) {
715
+ p.target.style.display = "none";
716
716
  }
717
717
  function oe() {
718
- const f = n.value.text || "";
719
- navigator.clipboard.writeText(f).then(() => {
720
- r.value = "Copied!", setTimeout(() => {
721
- r.value = "Copy";
722
- }, 2e3), L("copy", { platform: S.value, text: f });
718
+ const p = l.value.text || "";
719
+ navigator.clipboard.writeText(p).then(() => {
720
+ o.value = "Copied!", setTimeout(() => {
721
+ o.value = "Copy";
722
+ }, 2e3), T("copy", { platform: B.value, text: p });
723
723
  });
724
724
  }
725
- return (f, k) => {
726
- var ee, re, P, Q, w, T;
725
+ return (p, k) => {
726
+ var ee, re, A, Q, w, L;
727
727
  return a(), s("div", {
728
728
  ref_key: "containerRef",
729
729
  ref: m,
730
- class: N(["artifactuse-social", [`artifactuse-social-${S.value}`]]),
730
+ class: N(["artifactuse-social", [`artifactuse-social-${B.value}`]]),
731
731
  "data-artifactuse-theme": H.theme
732
732
  }, [
733
- S.value === "twitter" ? (a(), s(R, { key: 0 }, [
734
- e("div", Za, [
733
+ B.value === "twitter" ? (a(), s(R, { key: 0 }, [
734
+ e("div", Ga, [
735
735
  e("img", {
736
- src: h.value.avatar || he,
737
- alt: h.value.name,
736
+ src: y.value.avatar || _e,
737
+ alt: y.value.name,
738
738
  class: "artifactuse-social-avatar",
739
- onError: X
740
- }, null, 40, Ka),
741
- e("div", Ya, [
742
- e("div", Qa, [
743
- e("span", null, l(h.value.name), 1),
744
- h.value.verified ? (a(), s("svg", {
739
+ onError: Z
740
+ }, null, 40, es),
741
+ e("div", ts, [
742
+ e("div", as, [
743
+ e("span", null, n(y.value.name), 1),
744
+ y.value.verified ? (a(), s("svg", {
745
745
  key: 0,
746
746
  class: N(["artifactuse-social-verified", $.value]),
747
747
  viewBox: "0 0 24 24",
@@ -750,40 +750,40 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
750
750
  e("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" }, null, -1)
751
751
  ])], 2)) : v("", !0)
752
752
  ]),
753
- e("div", Ga, [
754
- e("span", es, l(h.value.handle), 1),
755
- e("span", ts, "· " + l(x.value.timestamp || "Just now"), 1)
753
+ e("div", ss, [
754
+ e("span", is, n(y.value.handle), 1),
755
+ e("span", ls, "· " + n(x.value.timestamp || "Just now"), 1)
756
756
  ])
757
757
  ])
758
758
  ]),
759
- e("div", as, [
759
+ e("div", ns, [
760
760
  e("p", {
761
761
  class: "artifactuse-social-text",
762
762
  innerHTML: W.value
763
- }, null, 8, ss),
764
- (ee = n.value.media) != null && ee.length ? (a(), s("div", is, [
763
+ }, null, 8, os),
764
+ (ee = l.value.media) != null && ee.length ? (a(), s("div", rs, [
765
765
  e("div", {
766
- class: N(["artifactuse-social-media-grid", { "artifactuse-social-media-single": n.value.media.length === 1 }]),
767
- "data-count": n.value.media.length
766
+ class: N(["artifactuse-social-media-grid", { "artifactuse-social-media-single": l.value.media.length === 1 }]),
767
+ "data-count": l.value.media.length
768
768
  }, [
769
- (a(!0), s(R, null, ve(n.value.media.slice(0, 4), (o, B) => (a(), s("img", {
770
- key: B,
771
- src: o.url,
772
- alt: o.alt || "",
773
- onError: J
774
- }, null, 40, ns))), 128))
775
- ], 10, ls)
769
+ (a(!0), s(R, null, ve(l.value.media.slice(0, 4), (r, E) => (a(), s("img", {
770
+ key: E,
771
+ src: r.url,
772
+ alt: r.alt || "",
773
+ onError: X
774
+ }, null, 40, us))), 128))
775
+ ], 10, cs)
776
776
  ])) : v("", !0),
777
- n.value.link && !((re = n.value.media) != null && re.length) ? (a(), s("div", os, [
778
- n.value.link.image ? (a(), s("img", {
777
+ l.value.link && !((re = l.value.media) != null && re.length) ? (a(), s("div", ds, [
778
+ l.value.link.image ? (a(), s("img", {
779
779
  key: 0,
780
- src: n.value.link.image,
781
- alt: n.value.link.title,
780
+ src: l.value.link.image,
781
+ alt: l.value.link.title,
782
782
  class: "artifactuse-social-link-image",
783
- onError: J
784
- }, null, 40, rs)) : v("", !0),
785
- e("div", cs, [
786
- e("div", us, [
783
+ onError: X
784
+ }, null, 40, vs)) : v("", !0),
785
+ e("div", fs, [
786
+ e("div", ps, [
787
787
  k[1] || (k[1] = e("svg", {
788
788
  fill: "none",
789
789
  viewBox: "0 0 24 24",
@@ -796,45 +796,45 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
796
796
  d: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
797
797
  })
798
798
  ], -1)),
799
- K(" " + l(n.value.link.domain || ie(n.value.link.url)), 1)
799
+ K(" " + n(l.value.link.domain || ie(l.value.link.url)), 1)
800
800
  ]),
801
- e("div", ds, l(n.value.link.title), 1),
802
- n.value.link.description ? (a(), s("div", vs, l(n.value.link.description), 1)) : v("", !0)
801
+ e("div", _s, n(l.value.link.title), 1),
802
+ l.value.link.description ? (a(), s("div", hs, n(l.value.link.description), 1)) : v("", !0)
803
803
  ])
804
804
  ])) : v("", !0),
805
- n.value.poll ? (a(), s("div", fs, [
806
- (a(!0), s(R, null, ve(n.value.poll.options, (o, B) => {
807
- var c, z;
805
+ l.value.poll ? (a(), s("div", ms, [
806
+ (a(!0), s(R, null, ve(l.value.poll.options, (r, E) => {
807
+ var u, z;
808
808
  return a(), s("div", {
809
- key: B,
809
+ key: E,
810
810
  class: "artifactuse-social-poll-option"
811
811
  }, [
812
812
  e("div", {
813
813
  class: "artifactuse-social-poll-bar",
814
- style: Pe({ width: `${((c = n.value.poll.votes) == null ? void 0 : c[B]) || 0}%` })
814
+ style: Pe({ width: `${((u = l.value.poll.votes) == null ? void 0 : u[E]) || 0}%` })
815
815
  }, null, 4),
816
- e("div", ps, [
817
- e("span", null, l(o), 1),
818
- e("span", hs, l(((z = n.value.poll.votes) == null ? void 0 : z[B]) || 0) + "%", 1)
816
+ e("div", ys, [
817
+ e("span", null, n(r), 1),
818
+ e("span", gs, n(((z = l.value.poll.votes) == null ? void 0 : z[E]) || 0) + "%", 1)
819
819
  ])
820
820
  ]);
821
821
  }), 128)),
822
- e("div", _s, l(E(n.value.poll.totalVotes || 0)) + " votes · " + l(n.value.poll.duration || "Poll ended"), 1)
822
+ e("div", ks, n(S(l.value.poll.totalVotes || 0)) + " votes · " + n(l.value.poll.duration || "Poll ended"), 1)
823
823
  ])) : v("", !0),
824
- n.value.quote ? (a(), s("div", ms, [
825
- e("div", ys, [
824
+ l.value.quote ? (a(), s("div", ws, [
825
+ e("div", bs, [
826
826
  e("img", {
827
- src: ((P = n.value.quote.author) == null ? void 0 : P.avatar) || he,
827
+ src: ((A = l.value.quote.author) == null ? void 0 : A.avatar) || _e,
828
828
  class: "artifactuse-social-quote-avatar"
829
- }, null, 8, gs),
830
- e("span", ks, l((Q = n.value.quote.author) == null ? void 0 : Q.name), 1),
831
- e("span", ws, l((w = n.value.quote.author) == null ? void 0 : w.handle), 1)
829
+ }, null, 8, Cs),
830
+ e("span", xs, n((Q = l.value.quote.author) == null ? void 0 : Q.name), 1),
831
+ e("span", $s, n((w = l.value.quote.author) == null ? void 0 : w.handle), 1)
832
832
  ]),
833
- e("p", Cs, l(n.value.quote.text), 1)
833
+ e("p", Ms, n(l.value.quote.text), 1)
834
834
  ])) : v("", !0)
835
835
  ]),
836
- F.value ? (a(), s("div", bs, [
837
- e("div", xs, [
836
+ F.value ? (a(), s("div", Ts, [
837
+ e("div", Ls, [
838
838
  k[2] || (k[2] = e("svg", {
839
839
  viewBox: "0 0 24 24",
840
840
  fill: "none",
@@ -843,9 +843,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
843
843
  }, [
844
844
  e("path", { d: "M12 21C6.5 21 2 16.5 2 11V3l7 3 3-3 3 3 7-3v8c0 5.5-4.5 10-10 10z" })
845
845
  ], -1)),
846
- e("span", null, l(E(p.value.replies || 0)), 1)
846
+ e("span", null, n(S(_.value.replies || 0)), 1)
847
847
  ]),
848
- e("div", $s, [
848
+ e("div", As, [
849
849
  k[3] || (k[3] = e("svg", {
850
850
  viewBox: "0 0 24 24",
851
851
  fill: "none",
@@ -854,9 +854,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
854
854
  }, [
855
855
  e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
856
856
  ], -1)),
857
- e("span", null, l(E(p.value.retweets || 0)), 1)
857
+ e("span", null, n(S(_.value.retweets || 0)), 1)
858
858
  ]),
859
- e("div", Ms, [
859
+ e("div", Ps, [
860
860
  k[4] || (k[4] = e("svg", {
861
861
  viewBox: "0 0 24 24",
862
862
  fill: "none",
@@ -865,9 +865,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
865
865
  }, [
866
866
  e("path", { d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" })
867
867
  ], -1)),
868
- e("span", null, l(E(p.value.likes || 0)), 1)
868
+ e("span", null, n(S(_.value.likes || 0)), 1)
869
869
  ]),
870
- e("div", Ls, [
870
+ e("div", Hs, [
871
871
  k[5] || (k[5] = e("svg", {
872
872
  viewBox: "0 0 24 24",
873
873
  fill: "none",
@@ -876,25 +876,25 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
876
876
  }, [
877
877
  e("path", { d: "M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4M10 17l5-5-5-5M13.8 12H3" })
878
878
  ], -1)),
879
- e("span", null, l(E(p.value.views || 0)), 1)
879
+ e("span", null, n(S(_.value.views || 0)), 1)
880
880
  ])
881
881
  ])) : v("", !0)
882
- ], 64)) : S.value === "linkedin" ? (a(), s(R, { key: 1 }, [
883
- e("div", Ts, [
882
+ ], 64)) : B.value === "linkedin" ? (a(), s(R, { key: 1 }, [
883
+ e("div", Bs, [
884
884
  e("img", {
885
- src: h.value.avatar || he,
886
- alt: h.value.name,
885
+ src: y.value.avatar || _e,
886
+ alt: y.value.name,
887
887
  class: "artifactuse-social-avatar",
888
- onError: X
889
- }, null, 40, Ps),
890
- e("div", As, [
891
- e("div", Hs, [
892
- K(l(h.value.name) + " ", 1),
893
- h.value.connection ? (a(), s("span", Ss, "· " + l(h.value.connection), 1)) : v("", !0)
888
+ onError: Z
889
+ }, null, 40, Es),
890
+ e("div", Ss, [
891
+ e("div", zs, [
892
+ K(n(y.value.name) + " ", 1),
893
+ y.value.connection ? (a(), s("span", Is, "· " + n(y.value.connection), 1)) : v("", !0)
894
894
  ]),
895
- e("div", Bs, l(h.value.headline), 1),
896
- e("div", Es, [
897
- K(l(x.value.timestamp || "Just now") + " · ", 1),
895
+ e("div", Fs, n(y.value.headline), 1),
896
+ e("div", Vs, [
897
+ K(n(x.value.timestamp || "Just now") + " · ", 1),
898
898
  k[6] || (k[6] = e("svg", {
899
899
  viewBox: "0 0 24 24",
900
900
  fill: "currentColor"
@@ -904,80 +904,80 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
904
904
  ])
905
905
  ])
906
906
  ]),
907
- e("div", zs, [
907
+ e("div", Rs, [
908
908
  e("p", {
909
909
  class: "artifactuse-social-text",
910
910
  innerHTML: W.value
911
- }, null, 8, Is),
912
- n.value.link ? (a(), s("div", Fs, [
913
- n.value.link.image ? (a(), s("img", {
911
+ }, null, 8, qs),
912
+ l.value.link ? (a(), s("div", Os, [
913
+ l.value.link.image ? (a(), s("img", {
914
914
  key: 0,
915
- src: n.value.link.image,
916
- alt: n.value.link.title,
915
+ src: l.value.link.image,
916
+ alt: l.value.link.title,
917
917
  class: "artifactuse-social-link-image",
918
- onError: J
919
- }, null, 40, Vs)) : v("", !0),
920
- e("div", Rs, [
921
- e("div", qs, l(n.value.link.title), 1),
922
- e("div", Os, l(n.value.link.domain || ie(n.value.link.url)), 1)
918
+ onError: X
919
+ }, null, 40, Us)) : v("", !0),
920
+ e("div", Ds, [
921
+ e("div", js, n(l.value.link.title), 1),
922
+ e("div", Ns, n(l.value.link.domain || ie(l.value.link.url)), 1)
923
923
  ])
924
924
  ])) : v("", !0)
925
925
  ]),
926
- F.value ? (a(), s("div", Us, [
927
- e("div", Ds, [
926
+ F.value ? (a(), s("div", Ws, [
927
+ e("div", Js, [
928
928
  k[7] || (k[7] = e("div", { class: "artifactuse-social-reaction-icons" }, [
929
929
  e("span", { class: "artifactuse-social-reaction-icon" }, "👍"),
930
930
  e("span", { class: "artifactuse-social-reaction-icon" }, "❤️"),
931
931
  e("span", { class: "artifactuse-social-reaction-icon" }, "👏")
932
932
  ], -1)),
933
- e("span", null, l(E(p.value.likes || 0)), 1)
933
+ e("span", null, n(S(_.value.likes || 0)), 1)
934
934
  ]),
935
- e("span", null, l(E(p.value.comments || 0)) + " comments · " + l(E(p.value.shares || 0)) + " shares", 1)
935
+ e("span", null, n(S(_.value.comments || 0)) + " comments · " + n(S(_.value.shares || 0)) + " shares", 1)
936
936
  ])) : v("", !0)
937
- ], 64)) : S.value === "instagram" ? (a(), s(R, { key: 2 }, [
938
- e("div", js, [
937
+ ], 64)) : B.value === "instagram" ? (a(), s(R, { key: 2 }, [
938
+ e("div", Xs, [
939
939
  e("img", {
940
- src: h.value.avatar || he,
941
- alt: h.value.name,
940
+ src: y.value.avatar || _e,
941
+ alt: y.value.name,
942
942
  class: "artifactuse-social-avatar",
943
- onError: X
944
- }, null, 40, Ns),
945
- e("div", Ws, [
946
- K(l(h.value.name) + " ", 1),
947
- h.value.verified ? (a(), s("svg", Js, [...k[8] || (k[8] = [
943
+ onError: Z
944
+ }, null, 40, Zs),
945
+ e("div", Ks, [
946
+ K(n(y.value.name) + " ", 1),
947
+ y.value.verified ? (a(), s("svg", Ys, [...k[8] || (k[8] = [
948
948
  e("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" }, null, -1)
949
949
  ])])) : v("", !0)
950
950
  ])
951
951
  ]),
952
- (T = n.value.media) != null && T.length ? (a(), s("div", Xs, [
952
+ (L = l.value.media) != null && L.length ? (a(), s("div", Qs, [
953
953
  e("img", {
954
- src: n.value.media[0].url,
955
- alt: n.value.media[0].alt || "",
956
- onError: J
957
- }, null, 40, Zs)
954
+ src: l.value.media[0].url,
955
+ alt: l.value.media[0].alt || "",
956
+ onError: X
957
+ }, null, 40, Gs)
958
958
  ])) : v("", !0),
959
- k[9] || (k[9] = It('<div class="artifactuse-social-actions"><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"></path></svg></div></div>', 1)),
960
- e("div", Ks, l(E(p.value.likes || 0)) + " likes", 1),
961
- e("div", Ys, [
962
- e("span", Qs, l(h.value.name), 1),
959
+ k[9] || (k[9] = qt('<div class="artifactuse-social-actions"><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"></path></svg></div></div>', 1)),
960
+ e("div", ei, n(S(_.value.likes || 0)) + " likes", 1),
961
+ e("div", ti, [
962
+ e("span", ai, n(y.value.name), 1),
963
963
  e("span", {
964
964
  class: "artifactuse-social-caption-text",
965
965
  innerHTML: W.value
966
- }, null, 8, Gs)
966
+ }, null, 8, si)
967
967
  ]),
968
- e("div", ei, l(x.value.timestamp || "Just now"), 1)
969
- ], 64)) : S.value === "facebook" ? (a(), s(R, { key: 3 }, [
970
- e("div", ti, [
968
+ e("div", ii, n(x.value.timestamp || "Just now"), 1)
969
+ ], 64)) : B.value === "facebook" ? (a(), s(R, { key: 3 }, [
970
+ e("div", li, [
971
971
  e("img", {
972
- src: h.value.avatar || he,
973
- alt: h.value.name,
972
+ src: y.value.avatar || _e,
973
+ alt: y.value.name,
974
974
  class: "artifactuse-social-avatar",
975
- onError: X
976
- }, null, 40, ai),
977
- e("div", si, [
978
- e("div", ii, l(h.value.name), 1),
979
- e("div", li, [
980
- K(l(x.value.timestamp || "Just now") + " · ", 1),
975
+ onError: Z
976
+ }, null, 40, ni),
977
+ e("div", oi, [
978
+ e("div", ri, n(y.value.name), 1),
979
+ e("div", ci, [
980
+ K(n(x.value.timestamp || "Just now") + " · ", 1),
981
981
  k[10] || (k[10] = e("svg", {
982
982
  viewBox: "0 0 24 24",
983
983
  fill: "currentColor"
@@ -987,63 +987,63 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
987
987
  ])
988
988
  ])
989
989
  ]),
990
- e("div", ni, [
990
+ e("div", ui, [
991
991
  e("p", {
992
992
  class: "artifactuse-social-text",
993
993
  innerHTML: W.value
994
- }, null, 8, oi),
995
- n.value.link ? (a(), s("div", ri, [
996
- n.value.link.image ? (a(), s("img", {
994
+ }, null, 8, di),
995
+ l.value.link ? (a(), s("div", vi, [
996
+ l.value.link.image ? (a(), s("img", {
997
997
  key: 0,
998
- src: n.value.link.image,
999
- alt: n.value.link.title,
998
+ src: l.value.link.image,
999
+ alt: l.value.link.title,
1000
1000
  class: "artifactuse-social-link-image",
1001
- onError: J
1002
- }, null, 40, ci)) : v("", !0),
1003
- e("div", ui, [
1004
- e("div", di, l(n.value.link.domain || ie(n.value.link.url)), 1),
1005
- e("div", vi, l(n.value.link.title), 1),
1006
- n.value.link.description ? (a(), s("div", fi, l(n.value.link.description), 1)) : v("", !0)
1001
+ onError: X
1002
+ }, null, 40, fi)) : v("", !0),
1003
+ e("div", pi, [
1004
+ e("div", _i, n(l.value.link.domain || ie(l.value.link.url)), 1),
1005
+ e("div", hi, n(l.value.link.title), 1),
1006
+ l.value.link.description ? (a(), s("div", mi, n(l.value.link.description), 1)) : v("", !0)
1007
1007
  ])
1008
1008
  ])) : v("", !0)
1009
1009
  ]),
1010
- F.value ? (a(), s("div", pi, [
1011
- e("div", hi, [
1010
+ F.value ? (a(), s("div", yi, [
1011
+ e("div", gi, [
1012
1012
  k[11] || (k[11] = e("div", { class: "artifactuse-social-reaction-emojis" }, [
1013
1013
  e("span", { class: "artifactuse-social-reaction-emoji" }, "👍"),
1014
1014
  e("span", { class: "artifactuse-social-reaction-emoji" }, "❤️"),
1015
1015
  e("span", { class: "artifactuse-social-reaction-emoji" }, "😂")
1016
1016
  ], -1)),
1017
- e("span", _i, l(E(Y.value)), 1)
1017
+ e("span", ki, n(S(Y.value)), 1)
1018
1018
  ]),
1019
- e("span", mi, l(E(p.value.comments || 0)) + " comments · " + l(E(p.value.shares || 0)) + " shares", 1)
1019
+ e("span", wi, n(S(_.value.comments || 0)) + " comments · " + n(S(_.value.shares || 0)) + " shares", 1)
1020
1020
  ])) : v("", !0)
1021
- ], 64)) : S.value === "threads" ? (a(), s(R, { key: 4 }, [
1022
- e("div", yi, [
1021
+ ], 64)) : B.value === "threads" ? (a(), s(R, { key: 4 }, [
1022
+ e("div", bi, [
1023
1023
  e("img", {
1024
- src: h.value.avatar || he,
1025
- alt: h.value.name,
1024
+ src: y.value.avatar || _e,
1025
+ alt: y.value.name,
1026
1026
  class: "artifactuse-social-avatar",
1027
- onError: X
1028
- }, null, 40, gi),
1029
- e("div", ki, [
1030
- e("div", wi, [
1031
- K(l(h.value.name) + " ", 1),
1032
- h.value.verified ? (a(), s("svg", Ci, [...k[12] || (k[12] = [
1027
+ onError: Z
1028
+ }, null, 40, Ci),
1029
+ e("div", xi, [
1030
+ e("div", $i, [
1031
+ K(n(y.value.name) + " ", 1),
1032
+ y.value.verified ? (a(), s("svg", Mi, [...k[12] || (k[12] = [
1033
1033
  e("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" }, null, -1)
1034
1034
  ])])) : v("", !0)
1035
1035
  ]),
1036
- e("span", bi, l(x.value.timestamp || "Just now"), 1)
1036
+ e("span", Ti, n(x.value.timestamp || "Just now"), 1)
1037
1037
  ])
1038
1038
  ]),
1039
- e("div", xi, [
1039
+ e("div", Li, [
1040
1040
  e("p", {
1041
1041
  class: "artifactuse-social-text",
1042
1042
  innerHTML: W.value
1043
- }, null, 8, $i)
1043
+ }, null, 8, Ai)
1044
1044
  ]),
1045
- F.value ? (a(), s("div", Mi, [
1046
- e("div", Li, [
1045
+ F.value ? (a(), s("div", Pi, [
1046
+ e("div", Hi, [
1047
1047
  k[13] || (k[13] = e("svg", {
1048
1048
  viewBox: "0 0 24 24",
1049
1049
  fill: "none",
@@ -1052,9 +1052,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1052
1052
  }, [
1053
1053
  e("path", { d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" })
1054
1054
  ], -1)),
1055
- e("span", null, l(E(p.value.likes || 0)), 1)
1055
+ e("span", null, n(S(_.value.likes || 0)), 1)
1056
1056
  ]),
1057
- e("div", Ti, [
1057
+ e("div", Bi, [
1058
1058
  k[14] || (k[14] = e("svg", {
1059
1059
  viewBox: "0 0 24 24",
1060
1060
  fill: "none",
@@ -1063,9 +1063,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1063
1063
  }, [
1064
1064
  e("path", { d: "M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z" })
1065
1065
  ], -1)),
1066
- e("span", null, l(E(p.value.comments || 0)), 1)
1066
+ e("span", null, n(S(_.value.comments || 0)), 1)
1067
1067
  ]),
1068
- e("div", Pi, [
1068
+ e("div", Ei, [
1069
1069
  k[15] || (k[15] = e("svg", {
1070
1070
  viewBox: "0 0 24 24",
1071
1071
  fill: "none",
@@ -1074,17 +1074,17 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1074
1074
  }, [
1075
1075
  e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
1076
1076
  ], -1)),
1077
- e("span", null, l(E(p.value.shares || 0)), 1)
1077
+ e("span", null, n(S(_.value.shares || 0)), 1)
1078
1078
  ])
1079
1079
  ])) : v("", !0)
1080
- ], 64)) : S.value === "tiktok" ? (a(), s(R, { key: 5 }, [
1081
- e("div", Ai, [
1082
- n.value.thumbnail ? (a(), s("img", {
1080
+ ], 64)) : B.value === "tiktok" ? (a(), s(R, { key: 5 }, [
1081
+ e("div", Si, [
1082
+ l.value.thumbnail ? (a(), s("img", {
1083
1083
  key: 0,
1084
- src: n.value.thumbnail,
1085
- alt: n.value.text,
1086
- onError: J
1087
- }, null, 40, Hi)) : v("", !0),
1084
+ src: l.value.thumbnail,
1085
+ alt: l.value.text,
1086
+ onError: X
1087
+ }, null, 40, zi)) : v("", !0),
1088
1088
  k[16] || (k[16] = e("div", { class: "artifactuse-social-play-button" }, [
1089
1089
  e("div", { class: "artifactuse-social-play-icon" }, [
1090
1090
  e("svg", {
@@ -1095,65 +1095,65 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1095
1095
  ])
1096
1096
  ])
1097
1097
  ], -1)),
1098
- n.value.duration ? (a(), s("div", Si, l(n.value.duration), 1)) : v("", !0)
1098
+ l.value.duration ? (a(), s("div", Ii, n(l.value.duration), 1)) : v("", !0)
1099
1099
  ]),
1100
- e("div", Bi, [
1101
- e("div", Ei, [
1100
+ e("div", Fi, [
1101
+ e("div", Vi, [
1102
1102
  e("img", {
1103
- src: h.value.avatar || he,
1104
- alt: h.value.name,
1103
+ src: y.value.avatar || _e,
1104
+ alt: y.value.name,
1105
1105
  class: "artifactuse-social-avatar",
1106
- onError: X
1107
- }, null, 40, zi),
1108
- e("span", Ii, l(h.value.name), 1)
1106
+ onError: Z
1107
+ }, null, 40, Ri),
1108
+ e("span", qi, n(y.value.name), 1)
1109
1109
  ]),
1110
1110
  e("p", {
1111
1111
  class: "artifactuse-social-text",
1112
1112
  innerHTML: W.value
1113
- }, null, 8, Fi),
1114
- n.value.sound ? (a(), s("div", Vi, [
1113
+ }, null, 8, Oi),
1114
+ l.value.sound ? (a(), s("div", Ui, [
1115
1115
  k[17] || (k[17] = e("svg", {
1116
1116
  viewBox: "0 0 24 24",
1117
1117
  fill: "currentColor"
1118
1118
  }, [
1119
1119
  e("path", { d: "M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z" })
1120
1120
  ], -1)),
1121
- K(" " + l(n.value.sound), 1)
1121
+ K(" " + n(l.value.sound), 1)
1122
1122
  ])) : v("", !0),
1123
- F.value ? (a(), s("div", Ri, [
1124
- e("span", null, l(E(p.value.likes || 0)) + " likes", 1),
1125
- e("span", null, l(E(p.value.comments || 0)) + " comments", 1),
1126
- e("span", null, l(E(p.value.shares || 0)) + " shares", 1)
1123
+ F.value ? (a(), s("div", Di, [
1124
+ e("span", null, n(S(_.value.likes || 0)) + " likes", 1),
1125
+ e("span", null, n(S(_.value.comments || 0)) + " comments", 1),
1126
+ e("span", null, n(S(_.value.shares || 0)) + " shares", 1)
1127
1127
  ])) : v("", !0)
1128
1128
  ])
1129
- ], 64)) : S.value === "youtube" ? (a(), s(R, { key: 6 }, [
1130
- e("div", qi, [
1131
- n.value.thumbnail ? (a(), s("img", {
1129
+ ], 64)) : B.value === "youtube" ? (a(), s(R, { key: 6 }, [
1130
+ e("div", ji, [
1131
+ l.value.thumbnail ? (a(), s("img", {
1132
1132
  key: 0,
1133
- src: n.value.thumbnail,
1134
- alt: n.value.title,
1135
- onError: J
1136
- }, null, 40, Oi)) : v("", !0),
1137
- n.value.duration ? (a(), s("div", Ui, l(n.value.duration), 1)) : v("", !0)
1133
+ src: l.value.thumbnail,
1134
+ alt: l.value.title,
1135
+ onError: X
1136
+ }, null, 40, Ni)) : v("", !0),
1137
+ l.value.duration ? (a(), s("div", Wi, n(l.value.duration), 1)) : v("", !0)
1138
1138
  ]),
1139
- e("div", Di, [
1139
+ e("div", Ji, [
1140
1140
  e("img", {
1141
- src: h.value.avatar || he,
1142
- alt: h.value.name,
1141
+ src: y.value.avatar || _e,
1142
+ alt: y.value.name,
1143
1143
  class: "artifactuse-social-avatar",
1144
- onError: X
1145
- }, null, 40, ji),
1144
+ onError: Z
1145
+ }, null, 40, Xi),
1146
1146
  e("div", null, [
1147
- e("div", Ni, l(n.value.title || n.value.text), 1),
1148
- e("div", Wi, l(h.value.name), 1),
1149
- e("div", Ji, l(E(p.value.views || 0)) + " views · " + l(x.value.timestamp || "Just now"), 1)
1147
+ e("div", Zi, n(l.value.title || l.value.text), 1),
1148
+ e("div", Ki, n(y.value.name), 1),
1149
+ e("div", Yi, n(S(_.value.views || 0)) + " views · " + n(x.value.timestamp || "Just now"), 1)
1150
1150
  ])
1151
1151
  ])
1152
1152
  ], 64)) : v("", !0),
1153
- e("div", Xi, [
1154
- e("div", Zi, [
1155
- (a(), xe(Ft(q.value))),
1156
- e("span", null, l(j.value), 1)
1153
+ e("div", Qi, [
1154
+ e("div", Gi, [
1155
+ (a(), xe(Ot(O.value))),
1156
+ e("span", null, n(j.value), 1)
1157
1157
  ]),
1158
1158
  e("button", {
1159
1159
  class: "artifactuse-social-copy-btn",
@@ -1175,31 +1175,31 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1175
1175
  }),
1176
1176
  e("path", { d: "M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" })
1177
1177
  ], -1)),
1178
- K(" " + l(r.value), 1)
1178
+ K(" " + n(o.value), 1)
1179
1179
  ])
1180
1180
  ])
1181
- ], 10, Xa);
1181
+ ], 10, Qa);
1182
1182
  };
1183
1183
  }
1184
- }, Yi = ["src", "alt"], Qi = ["src"], Gi = {
1184
+ }, tl = ["src", "alt"], al = ["src"], sl = {
1185
1185
  key: 2,
1186
1186
  class: "artifactuse-viewer-controls"
1187
- }, el = ["title"], tl = {
1187
+ }, il = ["title"], ll = {
1188
1188
  key: 0,
1189
1189
  viewBox: "0 0 24 24",
1190
1190
  fill: "none",
1191
1191
  stroke: "currentColor",
1192
1192
  "stroke-width": "2"
1193
- }, al = {
1193
+ }, nl = {
1194
1194
  key: 1,
1195
1195
  viewBox: "0 0 24 24",
1196
1196
  fill: "none",
1197
1197
  stroke: "currentColor",
1198
1198
  "stroke-width": "2"
1199
- }, sl = {
1199
+ }, ol = {
1200
1200
  key: 3,
1201
1201
  class: "artifactuse-viewer-caption"
1202
- }, il = {
1202
+ }, rl = {
1203
1203
  __name: "ArtifactuseViewer",
1204
1204
  props: {
1205
1205
  // Whether the viewer is open
@@ -1229,61 +1229,61 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1229
1229
  }
1230
1230
  },
1231
1231
  emits: ["close"],
1232
- setup(H, { emit: d }) {
1233
- const _ = H, L = d, m = M(null), r = M(!1);
1234
- function V() {
1235
- r.value = !1, L("close");
1232
+ setup(H, { emit: c }) {
1233
+ const h = H, T = c, m = M(null), o = M(!1);
1234
+ function q() {
1235
+ o.value = !1, T("close");
1236
1236
  }
1237
- function S() {
1238
- _.type === "image" && (r.value = !r.value);
1237
+ function B() {
1238
+ h.type === "image" && (o.value = !o.value);
1239
1239
  }
1240
- function h() {
1241
- const p = document.createElement("a");
1242
- p.href = _.src, p.download = _.alt || "download", document.body.appendChild(p), p.click(), document.body.removeChild(p);
1240
+ function y() {
1241
+ const _ = document.createElement("a");
1242
+ _.href = h.src, _.download = h.alt || "download", document.body.appendChild(_), _.click(), document.body.removeChild(_);
1243
1243
  }
1244
- function n(p) {
1245
- p.key === "Escape" && _.isOpen && V();
1244
+ function l(_) {
1245
+ _.key === "Escape" && h.isOpen && q();
1246
1246
  }
1247
- return de(() => _.isOpen, (p) => {
1248
- p ? (be(() => {
1247
+ return de(() => h.isOpen, (_) => {
1248
+ _ ? (Ce(() => {
1249
1249
  var x;
1250
1250
  (x = m.value) == null || x.focus();
1251
- }), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", r.value = !1);
1251
+ }), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", o.value = !1);
1252
1252
  }), $e(() => {
1253
- document.addEventListener("keydown", n);
1254
- }), De(() => {
1255
- document.removeEventListener("keydown", n), document.body.style.overflow = "";
1256
- }), (p, x) => (a(), xe(Vt, { to: "body" }, [
1257
- Be(Ae, { name: "artifactuse-viewer" }, {
1258
- default: He(() => [
1253
+ document.addEventListener("keydown", l);
1254
+ }), Ne(() => {
1255
+ document.removeEventListener("keydown", l), document.body.style.overflow = "";
1256
+ }), (_, x) => (a(), xe(Ut, { to: "body" }, [
1257
+ Se(He, { name: "artifactuse-viewer" }, {
1258
+ default: Be(() => [
1259
1259
  H.isOpen ? (a(), s("div", {
1260
1260
  key: 0,
1261
1261
  class: "artifactuse-viewer-overlay",
1262
- onClick: V,
1263
- onKeydown: Rt(V, ["escape"]),
1262
+ onClick: q,
1263
+ onKeydown: Dt(q, ["escape"]),
1264
1264
  tabindex: "-1",
1265
1265
  ref_key: "overlayRef",
1266
1266
  ref: m
1267
1267
  }, [
1268
1268
  e("div", {
1269
1269
  class: "artifactuse-viewer-content",
1270
- onClick: x[0] || (x[0] = me(() => {
1270
+ onClick: x[0] || (x[0] = he(() => {
1271
1271
  }, ["stop"]))
1272
1272
  }, [
1273
1273
  H.type === "image" ? (a(), s("img", {
1274
1274
  key: 0,
1275
1275
  src: H.src,
1276
1276
  alt: H.alt,
1277
- class: N(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed": r.value }]),
1278
- onClick: S
1279
- }, null, 10, Yi)) : H.type === "pdf" ? (a(), s("iframe", {
1277
+ class: N(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed": o.value }]),
1278
+ onClick: B
1279
+ }, null, 10, tl)) : H.type === "pdf" ? (a(), s("iframe", {
1280
1280
  key: 1,
1281
1281
  src: H.src,
1282
1282
  class: "artifactuse-viewer-pdf"
1283
- }, null, 8, Qi)) : v("", !0),
1283
+ }, null, 8, al)) : v("", !0),
1284
1284
  e("button", {
1285
1285
  class: "artifactuse-viewer-close",
1286
- onClick: V,
1286
+ onClick: q,
1287
1287
  title: "Close (Esc)"
1288
1288
  }, [...x[1] || (x[1] = [
1289
1289
  e("svg", {
@@ -1306,13 +1306,13 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1306
1306
  })
1307
1307
  ], -1)
1308
1308
  ])]),
1309
- H.type === "image" ? (a(), s("div", Gi, [
1309
+ H.type === "image" ? (a(), s("div", sl, [
1310
1310
  e("button", {
1311
1311
  class: "artifactuse-viewer-control",
1312
- onClick: me(S, ["stop"]),
1313
- title: r.value ? "Zoom out" : "Zoom in"
1312
+ onClick: he(B, ["stop"]),
1313
+ title: o.value ? "Zoom out" : "Zoom in"
1314
1314
  }, [
1315
- r.value ? (a(), s("svg", al, [...x[3] || (x[3] = [
1315
+ o.value ? (a(), s("svg", nl, [...x[3] || (x[3] = [
1316
1316
  e("circle", {
1317
1317
  cx: "11",
1318
1318
  cy: "11",
@@ -1330,7 +1330,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1330
1330
  x2: "14",
1331
1331
  y2: "11"
1332
1332
  }, null, -1)
1333
- ])])) : (a(), s("svg", tl, [...x[2] || (x[2] = [
1333
+ ])])) : (a(), s("svg", ll, [...x[2] || (x[2] = [
1334
1334
  e("circle", {
1335
1335
  cx: "11",
1336
1336
  cy: "11",
@@ -1355,10 +1355,10 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1355
1355
  y2: "11"
1356
1356
  }, null, -1)
1357
1357
  ])]))
1358
- ], 8, el),
1358
+ ], 8, il),
1359
1359
  e("button", {
1360
1360
  class: "artifactuse-viewer-control",
1361
- onClick: me(h, ["stop"]),
1361
+ onClick: he(y, ["stop"]),
1362
1362
  title: "Download"
1363
1363
  }, [...x[4] || (x[4] = [
1364
1364
  e("svg", {
@@ -1378,7 +1378,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1378
1378
  ], -1)
1379
1379
  ])])
1380
1380
  ])) : v("", !0),
1381
- H.caption ? (a(), s("div", sl, l(H.caption), 1)) : v("", !0)
1381
+ H.caption ? (a(), s("div", ol, n(H.caption), 1)) : v("", !0)
1382
1382
  ])
1383
1383
  ], 544)) : v("", !0)
1384
1384
  ]),
@@ -1386,7 +1386,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1386
1386
  })
1387
1387
  ]));
1388
1388
  }
1389
- }, ll = ["innerHTML"], Un = {
1389
+ }, cl = ["innerHTML"], Gn = {
1390
1390
  __name: "ArtifactuseAgentMessage",
1391
1391
  props: {
1392
1392
  // The raw message content (markdown/HTML from AI)
@@ -1447,33 +1447,33 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1447
1447
  "social-copy",
1448
1448
  "media-open"
1449
1449
  ],
1450
- setup(H, { expose: d, emit: _ }) {
1451
- const L = H, m = _, {
1452
- processMessage: r,
1453
- openArtifact: V,
1454
- state: S,
1455
- getTheme: h,
1456
- instance: n
1457
- } = Ee(), p = M(null), x = M(null), F = M(""), $ = M([]);
1450
+ setup(H, { expose: c, emit: h }) {
1451
+ const T = H, m = h, {
1452
+ processMessage: o,
1453
+ openArtifact: q,
1454
+ state: B,
1455
+ getTheme: y,
1456
+ instance: l
1457
+ } = ze(), _ = M(null), x = M(null), F = M(""), $ = M([]);
1458
1458
  let j = null;
1459
- const q = M(!1), W = M("image"), Y = M(""), E = M(""), ie = M(""), X = b(() => (h == null ? void 0 : h()) || "dark"), J = b(() => S.activeArtifactId), oe = b(() => {
1460
- var C;
1461
- return L.inlineCards ?? ((C = n == null ? void 0 : n.config) == null ? void 0 : C.inlineCards) ?? !0;
1462
- }), f = M(!1);
1459
+ const O = M(!1), W = M("image"), Y = M(""), S = M(""), ie = M(""), Z = C(() => (y == null ? void 0 : y()) || "dark"), X = C(() => B.activeArtifactId), oe = C(() => {
1460
+ var b;
1461
+ return T.inlineCards ?? ((b = l == null ? void 0 : l.config) == null ? void 0 : b.inlineCards) ?? !0;
1462
+ }), p = M(!1);
1463
1463
  $e(() => {
1464
- L.typing && (f.value = !0);
1465
- }), de(() => L.typing, (C) => {
1466
- C && (f.value = !0);
1464
+ T.typing && (p.value = !0);
1465
+ }), de(() => T.typing, (b) => {
1466
+ b && (p.value = !0);
1467
1467
  });
1468
- const k = b(() => f.value || L.isLastMessage ? "active" : "inactive");
1469
- function ee(C) {
1470
- if (!C) return null;
1468
+ const k = C(() => p.value || T.isLastMessage ? "active" : "inactive");
1469
+ function ee(b) {
1470
+ if (!b) return null;
1471
1471
  try {
1472
- const I = decodeURIComponent(escape(atob(C)));
1472
+ const I = decodeURIComponent(escape(atob(b)));
1473
1473
  return JSON.parse(I);
1474
1474
  } catch {
1475
1475
  try {
1476
- const D = C.replace(/&#10;/g, `
1476
+ const D = b.replace(/&#10;/g, `
1477
1477
  `).replace(/&#13;/g, "\r").replace(/&#9;/g, " ").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
1478
1478
  return JSON.parse(D);
1479
1479
  } catch (D) {
@@ -1481,496 +1481,508 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1481
1481
  }
1482
1482
  }
1483
1483
  }
1484
- const re = b(() => {
1485
- const C = [], I = F.value;
1486
- if (!I) return C;
1484
+ const re = C(() => {
1485
+ const b = [], I = F.value;
1486
+ if (!I) return b;
1487
1487
  const D = /<div\s+class="artifactuse-placeholder[^"]*"[^>]*data-artifact-id="([^"]+)"[^>]*data-artifact-type="([^"]+)"[^>]*data-artifact=["']([^"']*)["'][^>]*><\/div>/gi;
1488
- let te = 0, A;
1489
- for (; (A = D.exec(I)) !== null; ) {
1490
- if (A.index > te) {
1491
- const O = I.slice(te, A.index);
1492
- O.trim() && C.push({ type: "html", content: O });
1488
+ let te = 0, P;
1489
+ for (; (P = D.exec(I)) !== null; ) {
1490
+ if (P.index > te) {
1491
+ const U = I.slice(te, P.index);
1492
+ U.trim() && b.push({ type: "html", content: U });
1493
1493
  }
1494
- const ae = ee(A[3]), u = A[2];
1495
- ae && (u === "form" && ae.isInline ? C.push({ type: "form", artifact: ae }) : u === "social" ? C.push({ type: "social", artifact: ae }) : C.push({ type: "panel", artifact: ae })), te = A.index + A[0].length;
1494
+ const ae = ee(P[3]), d = P[2];
1495
+ ae && (d === "form" && ae.isInline ? b.push({ type: "form", artifact: ae }) : d === "social" ? b.push({ type: "social", artifact: ae }) : b.push({ type: "panel", artifact: ae })), te = P.index + P[0].length;
1496
1496
  }
1497
1497
  if (te < I.length) {
1498
1498
  const ae = I.slice(te);
1499
- ae.trim() && C.push({ type: "html", content: ae });
1499
+ ae.trim() && b.push({ type: "html", content: ae });
1500
1500
  }
1501
- return C.length === 0 && I.trim() && C.push({ type: "html", content: I }), C;
1501
+ return b.length === 0 && I.trim() && b.push({ type: "html", content: I }), b;
1502
1502
  });
1503
- function P(C) {
1504
- W.value = C.type || "image", Y.value = C.src || "", E.value = C.alt || "", ie.value = C.caption || "", q.value = !0, m("media-open", C);
1503
+ function A(b) {
1504
+ W.value = b.type || "image", Y.value = b.src || "", S.value = b.alt || "", ie.value = b.caption || "", O.value = !0, m("media-open", b);
1505
1505
  }
1506
1506
  function Q() {
1507
- q.value = !1, Y.value = "", E.value = "", ie.value = "";
1507
+ O.value = !1, Y.value = "", S.value = "", ie.value = "";
1508
1508
  }
1509
1509
  function w() {
1510
1510
  if (!x.value) return;
1511
- x.value.querySelectorAll('img[data-lightbox="true"]').forEach((u) => {
1512
- u._lightboxHandler && u.removeEventListener("click", u._lightboxHandler), u._lightboxHandler = (O) => {
1513
- O.preventDefault(), O.stopPropagation(), P({
1511
+ x.value.querySelectorAll('img[data-lightbox="true"]').forEach((d) => {
1512
+ d._lightboxHandler && d.removeEventListener("click", d._lightboxHandler), d._lightboxHandler = (U) => {
1513
+ U.preventDefault(), U.stopPropagation(), A({
1514
1514
  type: "image",
1515
- src: u.src,
1516
- alt: u.alt || "",
1517
- caption: u.dataset.caption || u.alt || ""
1515
+ src: d.src,
1516
+ alt: d.alt || "",
1517
+ caption: d.dataset.caption || d.alt || ""
1518
1518
  });
1519
- }, u.addEventListener("click", u._lightboxHandler), u.style.cursor = "zoom-in";
1520
- }), x.value.querySelectorAll(".artifactuse-image-container img").forEach((u) => {
1521
- u._lightboxHandler || (u._lightboxHandler = (O) => {
1522
- O.preventDefault(), O.stopPropagation();
1523
- const G = u.closest(".artifactuse-image-container"), ce = G == null ? void 0 : G.querySelector(".artifactuse-image-caption"), ke = (ce == null ? void 0 : ce.textContent) || u.dataset.caption || u.alt || "";
1524
- P({
1519
+ }, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in";
1520
+ }), x.value.querySelectorAll(".artifactuse-image-container img").forEach((d) => {
1521
+ d._lightboxHandler || (d._lightboxHandler = (U) => {
1522
+ U.preventDefault(), U.stopPropagation();
1523
+ const G = d.closest(".artifactuse-image-container"), ce = G == null ? void 0 : G.querySelector(".artifactuse-image-caption"), ke = (ce == null ? void 0 : ce.textContent) || d.dataset.caption || d.alt || "";
1524
+ A({
1525
1525
  type: "image",
1526
- src: u.src,
1527
- alt: u.alt || "",
1526
+ src: d.src,
1527
+ alt: d.alt || "",
1528
1528
  caption: ke
1529
1529
  });
1530
- }, u.addEventListener("click", u._lightboxHandler), u.style.cursor = "zoom-in");
1531
- }), x.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((u) => {
1532
- u._lightboxHandler || (u._lightboxHandler = (O) => {
1533
- O.preventDefault(), O.stopPropagation();
1534
- const G = u.closest(".artifactuse-gallery-item"), ce = G == null ? void 0 : G.querySelector(".artifactuse-gallery-caption"), ke = (ce == null ? void 0 : ce.textContent) || u.dataset.caption || u.alt || "";
1535
- P({
1530
+ }, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in");
1531
+ }), x.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((d) => {
1532
+ d._lightboxHandler || (d._lightboxHandler = (U) => {
1533
+ U.preventDefault(), U.stopPropagation();
1534
+ const G = d.closest(".artifactuse-gallery-item"), ce = G == null ? void 0 : G.querySelector(".artifactuse-gallery-caption"), ke = (ce == null ? void 0 : ce.textContent) || d.dataset.caption || d.alt || "";
1535
+ A({
1536
1536
  type: "image",
1537
- src: u.src,
1538
- alt: u.alt || "",
1537
+ src: d.src,
1538
+ alt: d.alt || "",
1539
1539
  caption: ke
1540
1540
  });
1541
- }, u.addEventListener("click", u._lightboxHandler), u.style.cursor = "zoom-in");
1542
- }), x.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((u) => {
1543
- u._pdfHandler && u.removeEventListener("click", u._pdfHandler), u._pdfHandler = (O) => {
1544
- O.preventDefault(), O.stopPropagation(), P({
1541
+ }, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in");
1542
+ }), x.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((d) => {
1543
+ d._pdfHandler && d.removeEventListener("click", d._pdfHandler), d._pdfHandler = (U) => {
1544
+ U.preventDefault(), U.stopPropagation(), A({
1545
1545
  type: "pdf",
1546
- src: u.href,
1547
- alt: u.textContent || "PDF Document",
1548
- caption: u.title || u.textContent || ""
1546
+ src: d.href,
1547
+ alt: d.textContent || "PDF Document",
1548
+ caption: d.title || d.textContent || ""
1549
1549
  });
1550
- }, u.addEventListener("click", u._pdfHandler);
1551
- }), x.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((u) => {
1550
+ }, d.addEventListener("click", d._pdfHandler);
1551
+ }), x.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((d) => {
1552
1552
  var G;
1553
- u._pdfHandler && u.removeEventListener("click", u._pdfHandler);
1554
- const O = u.dataset.pdfSrc || ((G = u.querySelector("iframe")) == null ? void 0 : G.src) || "";
1555
- O && (u._pdfHandler = (ce) => {
1556
- ce.preventDefault(), ce.stopPropagation(), P({
1553
+ d._pdfHandler && d.removeEventListener("click", d._pdfHandler);
1554
+ const U = d.dataset.pdfSrc || ((G = d.querySelector("iframe")) == null ? void 0 : G.src) || "";
1555
+ U && (d._pdfHandler = (ce) => {
1556
+ ce.preventDefault(), ce.stopPropagation(), A({
1557
1557
  type: "pdf",
1558
- src: O,
1558
+ src: U,
1559
1559
  alt: "PDF Document",
1560
- caption: u.dataset.caption || ""
1560
+ caption: d.dataset.caption || ""
1561
1561
  });
1562
- }, u.addEventListener("click", u._pdfHandler), u.style.cursor = "pointer");
1563
- }), x.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((u) => {
1564
- u._clickHandler && u.removeEventListener("click", u._clickHandler), u._clickHandler = (O) => {
1565
- if (O.target.closest(".artifactuse-video-play-button")) return;
1566
- const G = u.dataset.videoUrl || u.dataset.url;
1562
+ }, d.addEventListener("click", d._pdfHandler), d.style.cursor = "pointer");
1563
+ }), x.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((d) => {
1564
+ d._clickHandler && d.removeEventListener("click", d._clickHandler), d._clickHandler = (U) => {
1565
+ if (U.target.closest(".artifactuse-video-play-button")) return;
1566
+ const G = d.dataset.videoUrl || d.dataset.url;
1567
1567
  G && window.open(G, "_blank", "noopener,noreferrer");
1568
- }, u.addEventListener("click", u._clickHandler);
1568
+ }, d.addEventListener("click", d._clickHandler);
1569
1569
  });
1570
1570
  }
1571
- function T() {
1571
+ function L() {
1572
1572
  if (!x.value) return;
1573
- x.value.querySelectorAll("img").forEach((A) => {
1574
- A._lightboxHandler && (A.removeEventListener("click", A._lightboxHandler), delete A._lightboxHandler);
1575
- }), x.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((A) => {
1576
- A._pdfHandler && (A.removeEventListener("click", A._pdfHandler), delete A._pdfHandler);
1577
- }), x.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((A) => {
1578
- A._pdfHandler && (A.removeEventListener("click", A._pdfHandler), delete A._pdfHandler);
1579
- }), x.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((A) => {
1580
- A._clickHandler && (A.removeEventListener("click", A._clickHandler), delete A._clickHandler);
1573
+ x.value.querySelectorAll("img").forEach((P) => {
1574
+ P._lightboxHandler && (P.removeEventListener("click", P._lightboxHandler), delete P._lightboxHandler);
1575
+ }), x.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((P) => {
1576
+ P._pdfHandler && (P.removeEventListener("click", P._pdfHandler), delete P._pdfHandler);
1577
+ }), x.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((P) => {
1578
+ P._pdfHandler && (P.removeEventListener("click", P._pdfHandler), delete P._pdfHandler);
1579
+ }), x.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((P) => {
1580
+ P._clickHandler && (P.removeEventListener("click", P._clickHandler), delete P._clickHandler);
1581
1581
  });
1582
1582
  }
1583
- function o() {
1583
+ function r() {
1584
1584
  j && clearTimeout(j), j = setTimeout(async () => {
1585
- if (await be(), n != null && n.initializeContent && x.value)
1585
+ if (await Ce(), l != null && l.initializeContent && x.value)
1586
1586
  try {
1587
- await n.initializeContent(x.value);
1588
- } catch (C) {
1589
- console.error("Failed to initialize content:", C);
1587
+ await l.initializeContent(x.value);
1588
+ } catch (b) {
1589
+ console.error("Failed to initialize content:", b);
1590
1590
  }
1591
1591
  w();
1592
1592
  }, 100);
1593
1593
  }
1594
1594
  de(
1595
- () => L.content,
1596
- (C) => {
1597
- if (C) {
1598
- const I = r(C, L.messageId, {
1599
- inlinePreview: L.inlinePreview,
1600
- inlineCode: L.inlineCode,
1601
- tabs: L.tabs,
1602
- viewMode: L.viewMode
1595
+ () => T.content,
1596
+ (b) => {
1597
+ if (b) {
1598
+ const I = o(b, T.messageId, {
1599
+ inlinePreview: T.inlinePreview,
1600
+ inlineCode: T.inlineCode,
1601
+ tabs: T.tabs,
1602
+ viewMode: T.viewMode
1603
1603
  });
1604
- F.value = I.html, $.value = I.artifacts, I.artifacts.length > 0 && m("artifact-detected", I.artifacts), L.typing || o();
1604
+ F.value = I.html, $.value = I.artifacts, I.artifacts.length > 0 && m("artifact-detected", I.artifacts), T.typing || r();
1605
1605
  }
1606
1606
  },
1607
1607
  { immediate: !0 }
1608
1608
  ), de(
1609
- () => L.typing,
1610
- (C, I) => {
1611
- I === !0 && C === !1 && o();
1609
+ () => T.typing,
1610
+ (b, I) => {
1611
+ I === !0 && b === !1 && r();
1612
1612
  }
1613
1613
  ), $e(() => {
1614
- L.typing || o();
1615
- }), qt(() => {
1616
- j && clearTimeout(j), T();
1614
+ T.typing || r();
1615
+ }), jt(() => {
1616
+ j && clearTimeout(j), L();
1617
1617
  });
1618
- function B(C) {
1619
- const I = C.target.closest(".artifactuse-inline-preview");
1618
+ function E(b) {
1619
+ const I = b.target.closest(".artifactuse-inline-preview");
1620
1620
  if (I) {
1621
1621
  if (I.dataset.nonClickable) return;
1622
1622
  const D = I.dataset.artifactId;
1623
1623
  if (D) {
1624
- const te = S.artifacts.find((A) => A.id === D);
1625
- te && c(te);
1624
+ const te = B.artifacts.find((P) => P.id === D);
1625
+ te && u(te);
1626
1626
  }
1627
1627
  }
1628
1628
  }
1629
- function c(C) {
1630
- V(C), m("artifact-open", C);
1629
+ function u(b) {
1630
+ q(b), m("artifact-open", b);
1631
1631
  }
1632
- function z(C) {
1633
- m("artifact-copy", C);
1632
+ function z(b) {
1633
+ m("artifact-copy", b);
1634
1634
  }
1635
- function le(C) {
1636
- m("artifact-download", C);
1635
+ function le(b) {
1636
+ m("artifact-download", b);
1637
1637
  }
1638
- function pe(C) {
1639
- m("form-submit", C);
1638
+ function pe(b) {
1639
+ m("form-submit", b);
1640
1640
  }
1641
- function ye(C) {
1642
- m("form-cancel", C);
1641
+ function ye(b) {
1642
+ m("form-cancel", b);
1643
1643
  }
1644
- function fe(C) {
1645
- m("form-button-click", C);
1644
+ function fe(b) {
1645
+ m("form-button-click", b);
1646
1646
  }
1647
- function Le(C) {
1648
- m("social-copy", C);
1647
+ function Le(b) {
1648
+ m("social-copy", b);
1649
1649
  }
1650
- return b(() => S.artifacts.filter((C) => C.messageId === L.messageId)), d({
1651
- openViewer: P,
1650
+ return C(() => B.artifacts.filter((b) => b.messageId === T.messageId)), c({
1651
+ openViewer: A,
1652
1652
  closeViewer: Q,
1653
1653
  attachMediaListeners: w
1654
- }), (C, I) => (a(), s("div", {
1654
+ }), (b, I) => (a(), s("div", {
1655
1655
  class: "artifactuse-agent-message",
1656
1656
  ref_key: "messageRef",
1657
- ref: p
1657
+ ref: _
1658
1658
  }, [
1659
1659
  e("div", {
1660
1660
  class: "artifactuse-message-content",
1661
1661
  ref_key: "contentRef",
1662
1662
  ref: x,
1663
- onClick: B
1663
+ onClick: E
1664
1664
  }, [
1665
1665
  (a(!0), s(R, null, ve(re.value, (D, te) => (a(), s(R, { key: te }, [
1666
1666
  D.type === "html" ? (a(), s("div", {
1667
1667
  key: 0,
1668
1668
  innerHTML: D.content
1669
- }, null, 8, ll)) : D.type === "form" && D.artifact.isInline ? (a(), xe(Ja, {
1669
+ }, null, 8, cl)) : D.type === "form" && D.artifact.isInline ? (a(), xe(Ya, {
1670
1670
  key: 1,
1671
1671
  artifact: D.artifact,
1672
- theme: X.value,
1672
+ theme: Z.value,
1673
1673
  "initial-state": k.value,
1674
1674
  onSubmit: pe,
1675
1675
  onCancel: ye,
1676
1676
  onButtonClick: fe
1677
- }, null, 8, ["artifact", "theme", "initial-state"])) : D.type === "social" ? (a(), xe(Ki, {
1677
+ }, null, 8, ["artifact", "theme", "initial-state"])) : D.type === "social" ? (a(), xe(el, {
1678
1678
  key: 2,
1679
1679
  artifact: D.artifact,
1680
- theme: X.value,
1680
+ theme: Z.value,
1681
1681
  onCopy: Le
1682
- }, null, 8, ["artifact", "theme"])) : D.type === "panel" && oe.value ? (a(), xe(ia, {
1682
+ }, null, 8, ["artifact", "theme"])) : D.type === "panel" && oe.value ? (a(), xe(ra, {
1683
1683
  key: 3,
1684
1684
  artifact: D.artifact,
1685
- "is-active": J.value === D.artifact.id,
1686
- onOpen: c,
1685
+ "is-active": X.value === D.artifact.id,
1686
+ onOpen: u,
1687
1687
  onCopy: z,
1688
1688
  onDownload: le
1689
1689
  }, null, 8, ["artifact", "is-active"])) : v("", !0)
1690
1690
  ], 64))), 128))
1691
1691
  ], 512),
1692
- Be(il, {
1693
- "is-open": q.value,
1692
+ Se(rl, {
1693
+ "is-open": O.value,
1694
1694
  type: W.value,
1695
1695
  src: Y.value,
1696
- alt: E.value,
1696
+ alt: S.value,
1697
1697
  caption: ie.value,
1698
1698
  onClose: Q
1699
1699
  }, null, 8, ["is-open", "type", "src", "alt", "caption"])
1700
1700
  ], 512));
1701
1701
  }
1702
- }, nl = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, ol = { class: "artifactuse-panel__actions" }, rl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, cl = {
1702
+ }, ul = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, dl = { class: "artifactuse-panel__actions" }, vl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, fl = {
1703
1703
  key: 0,
1704
1704
  href: "https://artifactuse.com",
1705
1705
  target: "_blank",
1706
1706
  rel: "noopener noreferrer",
1707
1707
  class: "artifactuse-panel__branding"
1708
- }, ul = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, dl = { class: "artifactuse-panel__title" }, vl = { class: "artifactuse-panel__title-content" }, fl = { class: "artifactuse-panel__meta" }, pl = { class: "artifactuse-panel__actions" }, hl = ["disabled"], _l = {
1708
+ }, pl = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, _l = { class: "artifactuse-panel__title" }, hl = { class: "artifactuse-panel__title-content" }, ml = { class: "artifactuse-panel__meta" }, yl = { class: "artifactuse-panel__actions" }, gl = ["disabled"], kl = {
1709
1709
  key: 0,
1710
1710
  viewBox: "0 0 24 24",
1711
1711
  fill: "none",
1712
1712
  stroke: "currentColor",
1713
1713
  "stroke-width": "2"
1714
- }, ml = {
1714
+ }, wl = {
1715
1715
  key: 1,
1716
1716
  class: "artifactuse-panel__spinner-icon",
1717
1717
  viewBox: "0 0 24 24",
1718
1718
  fill: "none",
1719
1719
  stroke: "currentColor",
1720
1720
  "stroke-width": "2"
1721
- }, yl = { class: "artifactuse-panel__list" }, gl = { class: "artifactuse-panel__list-items" }, kl = ["onClick"], wl = ["innerHTML"], Cl = { class: "artifactuse-panel__list-item-content" }, bl = { class: "artifactuse-panel__list-item-title" }, xl = { class: "artifactuse-panel__list-item-meta" }, $l = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, Ml = {
1721
+ }, bl = { class: "artifactuse-panel__list" }, Cl = { class: "artifactuse-panel__list-items" }, xl = ["onClick"], $l = ["innerHTML"], Ml = { class: "artifactuse-panel__list-item-content" }, Tl = { class: "artifactuse-panel__list-item-title" }, Ll = { class: "artifactuse-panel__list-item-meta" }, Al = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, Pl = {
1722
1722
  key: 0,
1723
1723
  href: "https://artifactuse.com",
1724
1724
  target: "_blank",
1725
1725
  rel: "noopener noreferrer",
1726
1726
  class: "artifactuse-panel__branding"
1727
- }, Ll = { class: "artifactuse-panel__header" }, Tl = { class: "artifactuse-panel__title" }, Pl = ["innerHTML"], Al = { class: "artifactuse-panel__title-content" }, Hl = { class: "artifactuse-panel__name" }, Sl = { class: "artifactuse-panel__meta" }, Bl = { class: "artifactuse-panel__tabs" }, El = ["disabled"], zl = ["disabled"], Il = { class: "artifactuse-panel__actions" }, Fl = ["title"], Vl = {
1727
+ }, Hl = { class: "artifactuse-panel__header" }, Bl = ["title"], El = { class: "artifactuse-panel__title" }, Sl = ["innerHTML"], zl = { class: "artifactuse-panel__title-content" }, Il = { class: "artifactuse-panel__name" }, Fl = { class: "artifactuse-panel__meta" }, Vl = { class: "artifactuse-panel__tabs" }, Rl = ["disabled"], ql = ["disabled"], Ol = { class: "artifactuse-panel__actions" }, Ul = ["title"], Dl = {
1728
1728
  key: 0,
1729
1729
  viewBox: "0 0 24 24",
1730
1730
  fill: "none",
1731
1731
  stroke: "currentColor",
1732
1732
  "stroke-width": "2"
1733
- }, Rl = {
1733
+ }, jl = {
1734
1734
  key: 1,
1735
1735
  viewBox: "0 0 24 24",
1736
1736
  fill: "none",
1737
1737
  stroke: "currentColor",
1738
1738
  "stroke-width": "2"
1739
- }, ql = {
1739
+ }, Nl = {
1740
+ key: 0,
1741
+ class: "artifactuse-panel__file-tabs"
1742
+ }, Wl = { class: "artifactuse-panel__file-tabs-scroll" }, Jl = ["onClick"], Xl = ["innerHTML"], Zl = { class: "artifactuse-panel__file-tab-title" }, Kl = ["onClick"], Yl = {
1740
1743
  key: 0,
1741
1744
  class: "artifactuse-panel__loading"
1742
- }, Ol = {
1745
+ }, Ql = {
1743
1746
  key: 0,
1744
1747
  class: "artifactuse-panel__loading"
1745
- }, Ul = ["src"], Dl = {
1748
+ }, Gl = ["src"], en = {
1746
1749
  key: 2,
1747
1750
  class: "artifactuse-panel__no-preview"
1748
- }, jl = { class: "artifactuse-panel__edit" }, Nl = { class: "artifactuse-panel__footer" }, Wl = { class: "artifactuse-panel__footer-left" }, Jl = {
1751
+ }, tn = { class: "artifactuse-panel__edit" }, an = { class: "artifactuse-panel__footer" }, sn = { class: "artifactuse-panel__footer-left" }, ln = {
1749
1752
  key: 0,
1750
1753
  href: "https://artifactuse.com",
1751
1754
  target: "_blank",
1752
1755
  rel: "noopener noreferrer",
1753
1756
  class: "artifactuse-panel__branding"
1754
- }, Xl = {
1757
+ }, nn = {
1755
1758
  key: 1,
1756
1759
  class: "artifactuse-panel__badge"
1757
- }, Zl = { class: "artifactuse-panel__footer-right" }, Kl = ["title"], Yl = {
1760
+ }, on = { class: "artifactuse-panel__footer-right" }, rn = ["title"], cn = {
1758
1761
  key: 0,
1759
1762
  viewBox: "0 0 24 24",
1760
1763
  fill: "none",
1761
1764
  stroke: "currentColor",
1762
1765
  "stroke-width": "2"
1763
- }, Ql = {
1766
+ }, un = {
1764
1767
  key: 1,
1765
1768
  viewBox: "0 0 24 24",
1766
1769
  fill: "none",
1767
1770
  stroke: "currentColor",
1768
1771
  "stroke-width": "2"
1769
- }, Gl = {
1772
+ }, dn = {
1770
1773
  key: 0,
1771
1774
  style: { position: "relative" }
1772
- }, en = {
1775
+ }, vn = {
1773
1776
  key: 0,
1774
1777
  class: "artifactuse-share-popup"
1775
- }, tn = { class: "artifactuse-share-popup__header" }, an = { class: "artifactuse-share-popup__title" }, sn = { class: "artifactuse-share-popup__body" }, ln = {
1778
+ }, fn = { class: "artifactuse-share-popup__header" }, pn = { class: "artifactuse-share-popup__title" }, _n = { class: "artifactuse-share-popup__body" }, hn = {
1776
1779
  key: 0,
1777
1780
  class: "artifactuse-share-popup__loading"
1778
- }, nn = { key: 1 }, on = { class: "artifactuse-share-popup__error" }, rn = { class: "artifactuse-share-popup__error-text" }, cn = { class: "artifactuse-share-popup__actions" }, un = {
1781
+ }, mn = { key: 1 }, yn = { class: "artifactuse-share-popup__error" }, gn = { class: "artifactuse-share-popup__error-text" }, kn = { class: "artifactuse-share-popup__actions" }, wn = {
1779
1782
  key: 2,
1780
1783
  class: "artifactuse-share-popup__options"
1781
- }, dn = { key: 3 }, vn = {
1784
+ }, bn = { key: 3 }, Cn = {
1782
1785
  key: 0,
1783
1786
  class: "artifactuse-share-popup__loading"
1784
- }, fn = {
1787
+ }, xn = {
1785
1788
  key: 1,
1786
1789
  class: "artifactuse-share-popup__empty"
1787
- }, pn = {
1790
+ }, $n = {
1788
1791
  key: 2,
1789
1792
  class: "artifactuse-share-popup__artifact-list"
1790
- }, hn = ["onClick"], _n = { class: "artifactuse-share-popup__artifact-name" }, mn = { class: "artifactuse-share-popup__artifact-date" }, yn = {
1793
+ }, Mn = ["onClick"], Tn = { class: "artifactuse-share-popup__artifact-name" }, Ln = { class: "artifactuse-share-popup__artifact-date" }, An = {
1791
1794
  key: 4,
1792
1795
  class: "artifactuse-share-popup__success"
1793
- }, gn = { class: "artifactuse-share-popup__link-wrapper" }, kn = ["value"], wn = {
1796
+ }, Pn = { class: "artifactuse-share-popup__link-wrapper" }, Hn = ["value"], Bn = {
1794
1797
  key: 0,
1795
1798
  class: "artifactuse-share-popup__expiry"
1796
- }, Cn = { class: "artifactuse-share-popup__expiry-text" }, bn = {
1799
+ }, En = { class: "artifactuse-share-popup__expiry-text" }, Sn = {
1797
1800
  key: 1,
1798
1801
  class: "artifactuse-share-popup__save-prompt"
1799
- }, xn = {
1802
+ }, zn = {
1800
1803
  key: 2,
1801
1804
  class: "artifactuse-panel__nav"
1802
- }, $n = ["disabled"], Mn = ["disabled"], Ln = {
1805
+ }, In = ["disabled"], Fn = ["disabled"], Vn = {
1803
1806
  key: 0,
1804
1807
  class: "artifactuse-panel__artifact-list"
1805
- }, Tn = { class: "artifactuse-panel__artifact-list-header" }, Pn = { class: "artifactuse-panel__artifact-list-items" }, An = ["onClick"], Hn = ["innerHTML"], Sn = { class: "artifactuse-panel__artifact-item-content" }, Bn = { class: "artifactuse-panel__artifact-item-title" }, En = { class: "artifactuse-panel__artifact-item-meta" }, zn = { class: "artifactuse-panel__artifact-item-index" }, Dn = {
1808
+ }, Rn = { class: "artifactuse-panel__artifact-list-header" }, qn = { class: "artifactuse-panel__artifact-list-items" }, On = ["onClick"], Un = ["innerHTML"], Dn = { class: "artifactuse-panel__artifact-item-content" }, jn = { class: "artifactuse-panel__artifact-item-title" }, Nn = { class: "artifactuse-panel__artifact-item-meta" }, Wn = { class: "artifactuse-panel__artifact-item-index" }, eo = {
1806
1809
  __name: "ArtifactusePanel",
1807
1810
  props: {
1808
1811
  panelWidth: { type: Number, default: void 0 },
1809
1812
  splitPosition: { type: Number, default: void 0 }
1810
1813
  },
1811
1814
  emits: ["close", "ai-request", "save", "export", "resize"],
1812
- setup(H, { emit: d }) {
1813
- var et, tt;
1814
- const _ = d, L = H, {
1815
+ setup(H, { emit: c }) {
1816
+ var at, st;
1817
+ const h = c, T = H, {
1815
1818
  state: m,
1816
- activeArtifact: r,
1817
- artifactCount: V,
1818
- hasArtifacts: S,
1819
- closePanel: h,
1820
- toggleFullscreen: n,
1821
- setViewMode: p,
1819
+ activeArtifact: o,
1820
+ artifactCount: q,
1821
+ hasArtifacts: B,
1822
+ closePanel: y,
1823
+ toggleFullscreen: l,
1824
+ setViewMode: _,
1822
1825
  getPanelUrl: x,
1823
1826
  openArtifact: F,
1824
1827
  instance: $
1825
- } = Ee(), j = M(null), q = M(null), W = M(null), Y = M(null), E = M(null), ie = M(null), X = M(!1), J = M(!1), oe = M(!0), f = M(!1), k = M(!1), ee = M(!1), re = M(!1), P = M("options"), Q = M(""), w = M(null), T = M(""), o = M(!1), B = M(!1), c = M([]), z = M(!1), le = M("");
1828
+ } = ze(), j = M(null), O = M(null), W = M(null), Y = M(null), S = M(null), ie = M(null), Z = M(!1), X = M(!1), oe = M(!0), p = M(!1), k = M(!1), ee = M(!1), re = M(!1), A = M("options"), Q = M(""), w = M(null), L = M(""), r = M(!1), E = M(!1), u = M([]), z = M(!1), le = M("");
1826
1829
  let pe = null, ye = null, fe = null;
1827
- const Le = b(() => {
1830
+ const Le = C(() => {
1828
1831
  var i;
1829
1832
  return ((i = $.editor) == null ? void 0 : i.isAvailable()) || !1;
1830
- }), C = M(
1831
- Math.min(Math.max(L.panelWidth ?? ((et = $.config) == null ? void 0 : et.panelWidth) ?? 65, 25), 75)
1833
+ }), b = M(
1834
+ Math.min(Math.max(T.panelWidth ?? ((at = $.config) == null ? void 0 : at.panelWidth) ?? 65, 25), 75)
1832
1835
  ), I = M(
1833
- Math.min(Math.max(L.splitPosition ?? ((tt = $.config) == null ? void 0 : tt.splitPosition) ?? 50, 20), 80)
1834
- ), D = b(() => r.value ? Se(r.value.language) : ""), te = b(() => r.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${Oe(r.value.language)}</svg>` : ""), A = b(() => {
1835
- if (!r.value) return null;
1836
- let i = x(r.value);
1837
- return i && r.value._refreshToken && (i += (i.includes("?") ? "&" : "?") + "_t=" + r.value._refreshToken), i;
1836
+ Math.min(Math.max(T.splitPosition ?? ((st = $.config) == null ? void 0 : st.splitPosition) ?? 50, 20), 80)
1837
+ ), D = C(() => o.value ? Ee(o.value.language) : ""), te = C(() => o.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${De(o.value.language)}</svg>` : ""), P = C(() => {
1838
+ if (!o.value) return null;
1839
+ let i = x(o.value);
1840
+ return i && o.value._refreshToken && (i += (i.includes("?") ? "&" : "?") + "_t=" + o.value._refreshToken), i;
1838
1841
  });
1839
- b(() => !r.value || !m.artifacts.length ? -1 : m.artifacts.findIndex((i) => i.id === r.value.id));
1840
- const ae = b(() => r.value ? Dt(r.value.language || "plaintext") : "plaintext"), u = b(() => m.artifacts.filter((i) => !i.isInline)), O = b(() => r.value ? u.value.findIndex((i) => i.id === r.value.id) : -1), G = b(() => {
1842
+ C(() => !o.value || !m.artifacts.length ? -1 : m.artifacts.findIndex((i) => i.id === o.value.id));
1843
+ const ae = C(() => o.value ? Jt(o.value.language || "plaintext") : "plaintext"), d = C(() => m.artifacts.filter((i) => !i.isInline)), U = C(() => o.value ? d.value.findIndex((i) => i.id === o.value.id) : -1), G = C(() => {
1841
1844
  var i;
1842
1845
  return ((i = $.config) == null ? void 0 : i.branding) !== !1;
1843
- }), ce = b(() => {
1846
+ }), ce = C(() => {
1844
1847
  var i;
1845
1848
  return ((i = $.share) == null ? void 0 : i.enabled) !== !1;
1846
- }), ke = b(() => {
1849
+ }), ke = C(() => {
1847
1850
  var i;
1848
1851
  return ((i = $.share) == null ? void 0 : i.isAuthenticated()) || !1;
1849
- }), ut = b(() => r.value ? C.value : Math.min(C.value, 30));
1850
- function je(i) {
1851
- return `<svg viewBox="0 0 24 24" fill="currentColor">${Oe(i)}</svg>`;
1852
+ }), vt = C(() => o.value ? b.value : Math.min(b.value, 30)), Me = C(() => {
1853
+ var i;
1854
+ return ((i = $.config) == null ? void 0 : i.multiTab) === !0;
1855
+ }), We = C(() => Me.value ? m.openTabs.map((i) => m.artifacts.find((t) => t.id === i)).filter(Boolean) : []);
1856
+ function Ie(i) {
1857
+ return `<svg viewBox="0 0 24 24" fill="currentColor">${De(i)}</svg>`;
1858
+ }
1859
+ function ft(i) {
1860
+ F(i);
1861
+ }
1862
+ function pt(i) {
1863
+ $.closeTab(i), m.openTabs.length === 0 && (k.value = !1);
1852
1864
  }
1853
- function dt() {
1865
+ function _t() {
1854
1866
  k.value = !1, $.state.clearActiveArtifact();
1855
1867
  }
1856
- function Ne(i) {
1868
+ function Je(i) {
1857
1869
  if (i.language !== "smartdiff") return null;
1858
1870
  try {
1859
1871
  const t = JSON.parse(i.code);
1860
1872
  if (t.oldCode === void 0 || t.newCode === void 0) return null;
1861
- const y = t.language || "plaintext", U = it() && window.Prism.languages[y], Z = jt(t.oldCode, t.newCode).split(`
1873
+ const f = t.language || "plaintext", V = nt() && window.Prism.languages[f], J = Xt(t.oldCode, t.newCode).split(`
1862
1874
  `);
1863
- return { html: Z.map((ue) => {
1864
- const ne = ue[0], Ce = ue.slice(1), ge = U ? window.Prism.highlight(Ce, U, y) : Ce;
1875
+ return { html: J.map((ue) => {
1876
+ const ne = ue[0], be = ue.slice(1), ge = V ? window.Prism.highlight(be, V, f) : be;
1865
1877
  return ne === "-" ? `<span class="token deleted">${ge}</span>` : ne === "+" ? `<span class="token inserted">${ge}</span>` : ge;
1866
1878
  }).join(`
1867
- `), lineCount: Z.length };
1879
+ `), lineCount: J.length };
1868
1880
  } catch {
1869
1881
  return null;
1870
1882
  }
1871
1883
  }
1872
- function vt() {
1884
+ function ht() {
1873
1885
  var i;
1874
- if (Y.value && ((i = r.value) != null && i.code)) {
1875
- const t = Ne(r.value), y = t ? t.lineCount : r.value.code.split(`
1886
+ if (Y.value && ((i = o.value) != null && i.code)) {
1887
+ const t = Je(o.value), f = t ? t.lineCount : o.value.code.split(`
1876
1888
  `).length;
1877
- Y.value.innerHTML = Array.from({ length: y }, (U, Z) => `<div>${Z + 1}</div>`).join("");
1889
+ Y.value.innerHTML = Array.from({ length: f }, (V, J) => `<div>${J + 1}</div>`).join("");
1878
1890
  }
1879
1891
  }
1880
- function ft() {
1892
+ function mt() {
1881
1893
  var i;
1882
- if (q.value && it() && ((i = r.value) != null && i.code)) {
1883
- const t = Ne(r.value);
1894
+ if (O.value && nt() && ((i = o.value) != null && i.code)) {
1895
+ const t = Je(o.value);
1884
1896
  if (t)
1885
- q.value.innerHTML = t.html;
1897
+ O.value.innerHTML = t.html;
1886
1898
  else {
1887
- const y = window.Prism.languages[ae.value];
1888
- y ? q.value.innerHTML = window.Prism.highlight(
1889
- r.value.code,
1890
- y,
1899
+ const f = window.Prism.languages[ae.value];
1900
+ f ? O.value.innerHTML = window.Prism.highlight(
1901
+ o.value.code,
1902
+ f,
1891
1903
  ae.value
1892
- ) : q.value.textContent = r.value.code;
1904
+ ) : O.value.textContent = o.value.code;
1893
1905
  }
1894
- q.value.dataset.highlighted = "true", be(() => {
1895
- pt();
1906
+ O.value.dataset.highlighted = "true", Ce(() => {
1907
+ yt();
1896
1908
  });
1897
1909
  }
1898
1910
  }
1899
- function pt() {
1911
+ function yt() {
1900
1912
  var t;
1901
- const i = (t = q.value) == null ? void 0 : t.closest("pre");
1902
- if (i && E.value && Y.value) {
1903
- const U = window.getComputedStyle(i).backgroundColor;
1904
- U && U !== "rgba(0, 0, 0, 0)" && U !== "transparent" && (E.value.style.backgroundColor = U, Y.value.style.backgroundColor = U);
1913
+ const i = (t = O.value) == null ? void 0 : t.closest("pre");
1914
+ if (i && S.value && Y.value) {
1915
+ const V = window.getComputedStyle(i).backgroundColor;
1916
+ V && V !== "rgba(0, 0, 0, 0)" && V !== "transparent" && (S.value.style.backgroundColor = V, Y.value.style.backgroundColor = V);
1905
1917
  }
1906
1918
  }
1907
- function ht() {
1908
- E.value && (E.value.style.backgroundColor = ""), Y.value && (Y.value.style.backgroundColor = "");
1919
+ function gt() {
1920
+ S.value && (S.value.style.backgroundColor = ""), Y.value && (Y.value.style.backgroundColor = "");
1909
1921
  }
1910
- function Te() {
1911
- be(() => {
1912
- vt(), ft();
1922
+ function Ae() {
1923
+ Ce(() => {
1924
+ ht(), mt();
1913
1925
  });
1914
1926
  }
1915
- function We() {
1916
- !Le.value || !ie.value || !r.value || (ze(), fe = $.editor.create(ie.value, {
1917
- code: r.value.code || "",
1918
- language: r.value.editorLanguage || r.value.language || "plaintext",
1927
+ function Xe() {
1928
+ !Le.value || !ie.value || !o.value || (Fe(), fe = $.editor.create(ie.value, {
1929
+ code: o.value.code || "",
1930
+ language: o.value.editorLanguage || o.value.language || "plaintext",
1919
1931
  sdkTheme: $.getTheme()
1920
1932
  }));
1921
1933
  }
1922
- function ze() {
1934
+ function Fe() {
1923
1935
  fe && (fe.destroy(), fe = null);
1924
1936
  }
1925
- function _t() {
1926
- if (!fe || !r.value) return;
1937
+ function kt() {
1938
+ if (!fe || !o.value) return;
1927
1939
  const i = fe.getCode();
1928
1940
  $.emit("edit:save", {
1929
- artifactId: r.value.id,
1930
- artifact: r.value,
1941
+ artifactId: o.value.id,
1942
+ artifact: o.value,
1931
1943
  code: i
1932
1944
  });
1933
1945
  }
1934
- function mt() {
1935
- clearTimeout(ye), oe.value = !1, j.value && r.value && ($.bridge.setIframe(j.value), $.bridge.loadArtifact(r.value));
1946
+ function wt() {
1947
+ clearTimeout(ye), oe.value = !1, j.value && o.value && ($.bridge.setIframe(j.value), $.bridge.loadArtifact(o.value));
1936
1948
  }
1937
- function yt() {
1949
+ function bt() {
1938
1950
  clearTimeout(ye), oe.value = !1;
1939
1951
  }
1940
- function gt() {
1952
+ function Ct() {
1941
1953
  clearTimeout(ye), ye = setTimeout(() => {
1942
1954
  oe.value = !1;
1943
1955
  }, 1e3);
1944
1956
  }
1945
- async function kt() {
1946
- if (r.value)
1957
+ async function xt() {
1958
+ if (o.value)
1947
1959
  try {
1948
- await navigator.clipboard.writeText(r.value.code), X.value = !0, setTimeout(() => {
1949
- X.value = !1;
1960
+ await navigator.clipboard.writeText(o.value.code), Z.value = !0, setTimeout(() => {
1961
+ Z.value = !1;
1950
1962
  }, 2e3);
1951
1963
  } catch (i) {
1952
1964
  console.error("Failed to copy:", i);
1953
1965
  }
1954
1966
  }
1955
- function wt() {
1956
- if (!r.value) return;
1957
- const { code: i, language: t, title: y } = r.value, U = Ue(t), Z = `${y.toLowerCase().replace(/\s+/g, "-")}.${U}`, _e = new Blob([i], { type: "text/plain" }), ue = URL.createObjectURL(_e), ne = document.createElement("a");
1958
- ne.href = ue, ne.download = Z, document.body.appendChild(ne), ne.click(), document.body.removeChild(ne), URL.revokeObjectURL(ue);
1967
+ function $t() {
1968
+ if (!o.value) return;
1969
+ const { code: i, language: t, title: f } = o.value, V = je(t), J = `${f.toLowerCase().replace(/\s+/g, "-")}.${V}`, me = new Blob([i], { type: "text/plain" }), ue = URL.createObjectURL(me), ne = document.createElement("a");
1970
+ ne.href = ue, ne.download = J, document.body.appendChild(ne), ne.click(), document.body.removeChild(ne), URL.revokeObjectURL(ue);
1959
1971
  }
1960
- async function Ct() {
1961
- if (!(ee.value || u.value.length === 0)) {
1972
+ async function Mt() {
1973
+ if (!(ee.value || d.value.length === 0)) {
1962
1974
  ee.value = !0;
1963
1975
  try {
1964
- const i = new Wt(), t = /* @__PURE__ */ new Map();
1965
- for (const ne of u.value) {
1976
+ const i = new Kt(), t = /* @__PURE__ */ new Map();
1977
+ for (const ne of d.value) {
1966
1978
  if (!ne.code) continue;
1967
- const Ce = Ue(ne.language);
1968
- let ge = (ne.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Re = `${ge}.${Ce}`;
1969
- const qe = t.get(Re) || 0;
1970
- qe > 0 && (Re = `${ge}-${qe}.${Ce}`), t.set(`${ge}.${Ce}`, qe + 1), i.file(Re, ne.code);
1979
+ const be = je(ne.language);
1980
+ let ge = (ne.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Oe = `${ge}.${be}`;
1981
+ const Ue = t.get(Oe) || 0;
1982
+ Ue > 0 && (Oe = `${ge}-${Ue}.${be}`), t.set(`${ge}.${be}`, Ue + 1), i.file(Oe, ne.code);
1971
1983
  }
1972
- const y = await i.generateAsync({ type: "blob" }), Z = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, _e = URL.createObjectURL(y), ue = document.createElement("a");
1973
- ue.href = _e, ue.download = Z, document.body.appendChild(ue), ue.click(), document.body.removeChild(ue), URL.revokeObjectURL(_e);
1984
+ const f = await i.generateAsync({ type: "blob" }), J = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, me = URL.createObjectURL(f), ue = document.createElement("a");
1985
+ ue.href = me, ue.download = J, document.body.appendChild(ue), ue.click(), document.body.removeChild(ue), URL.revokeObjectURL(me);
1974
1986
  } catch (i) {
1975
1987
  console.error("Failed to create ZIP:", i);
1976
1988
  } finally {
@@ -1978,205 +1990,205 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
1978
1990
  }
1979
1991
  }
1980
1992
  }
1981
- function bt() {
1993
+ function Tt() {
1982
1994
  if (re.value) {
1983
1995
  re.value = !1;
1984
1996
  return;
1985
1997
  }
1986
- r.value && (P.value = "options", Q.value = "", w.value = null, T.value = "", o.value = !1, B.value = !1, c.value = [], z.value = !1, le.value = "", re.value = !0);
1998
+ o.value && (A.value = "options", Q.value = "", w.value = null, L.value = "", r.value = !1, E.value = !1, u.value = [], z.value = !1, le.value = "", re.value = !0);
1987
1999
  }
1988
- function xt() {
2000
+ function Lt() {
1989
2001
  re.value = !1;
1990
2002
  }
1991
- function Je(i) {
2003
+ function Ze(i) {
1992
2004
  return i ? new Date(i).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "";
1993
2005
  }
1994
- async function Xe() {
1995
- if (!(!r.value || !$.share)) {
1996
- P.value = "loading", T.value = "";
2006
+ async function Ke() {
2007
+ if (!(!o.value || !$.share)) {
2008
+ A.value = "loading", L.value = "";
1997
2009
  try {
1998
- const i = await $.share.share(r.value);
1999
- Q.value = i.url, w.value = i.expiresAt, B.value = !1, P.value = "success";
2010
+ const i = await $.share.share(o.value);
2011
+ Q.value = i.url, w.value = i.expiresAt, E.value = !1, A.value = "success";
2000
2012
  } catch (i) {
2001
- T.value = i.message || "Failed to create share link", P.value = "error";
2013
+ L.value = i.message || "Failed to create share link", A.value = "error";
2002
2014
  }
2003
2015
  }
2004
2016
  }
2005
- async function Ze() {
2017
+ async function Ye() {
2006
2018
  if (ke.value)
2007
- Ie();
2019
+ Ve();
2008
2020
  else {
2009
- P.value = "loading";
2021
+ A.value = "loading";
2010
2022
  try {
2011
- await $.share.openAuthPopup(), Ie();
2023
+ await $.share.openAuthPopup(), Ve();
2012
2024
  } catch (i) {
2013
- i.message === "Authentication cancelled" ? P.value = "options" : (T.value = i.message || "Authentication failed", P.value = "error");
2025
+ i.message === "Authentication cancelled" ? A.value = "options" : (L.value = i.message || "Authentication failed", A.value = "error");
2014
2026
  }
2015
2027
  }
2016
2028
  }
2017
- async function Ie() {
2018
- if (!(!r.value || !$.share)) {
2019
- P.value = "loading", T.value = "";
2029
+ async function Ve() {
2030
+ if (!(!o.value || !$.share)) {
2031
+ A.value = "loading", L.value = "";
2020
2032
  try {
2021
- const i = await $.share.save(r.value);
2022
- Q.value = i.url, w.value = null, B.value = !0, P.value = "success";
2033
+ const i = await $.share.save(o.value);
2034
+ Q.value = i.url, w.value = null, E.value = !0, A.value = "success";
2023
2035
  } catch (i) {
2024
- T.value = i.message || "Failed to save artifact", P.value = "error";
2036
+ L.value = i.message || "Failed to save artifact", A.value = "error";
2025
2037
  }
2026
2038
  }
2027
2039
  }
2028
- function $t() {
2029
- B.value ? Ie() : Xe();
2040
+ function At() {
2041
+ E.value ? Ve() : Ke();
2030
2042
  }
2031
- async function Mt() {
2043
+ async function Pt() {
2032
2044
  var i;
2033
2045
  if ($.share) {
2034
2046
  if (!ke.value) {
2035
- P.value = "loading";
2047
+ A.value = "loading";
2036
2048
  try {
2037
2049
  await $.share.openAuthPopup();
2038
2050
  } catch (t) {
2039
- t.message === "Authentication cancelled" ? P.value = "options" : (T.value = t.message || "Authentication failed", P.value = "error");
2051
+ t.message === "Authentication cancelled" ? A.value = "options" : (L.value = t.message || "Authentication failed", A.value = "error");
2040
2052
  return;
2041
2053
  }
2042
2054
  }
2043
- P.value = "update-list", z.value = !0;
2055
+ A.value = "update-list", z.value = !0;
2044
2056
  try {
2045
- const t = ((i = r.value) == null ? void 0 : i.language) || null, y = await $.share.listArtifacts(t);
2046
- c.value = y.projects || [];
2057
+ const t = ((i = o.value) == null ? void 0 : i.language) || null, f = await $.share.listArtifacts(t);
2058
+ u.value = f.projects || [];
2047
2059
  } catch (t) {
2048
- T.value = t.message || "Failed to load artifacts", P.value = "error";
2060
+ L.value = t.message || "Failed to load artifacts", A.value = "error";
2049
2061
  } finally {
2050
2062
  z.value = !1;
2051
2063
  }
2052
2064
  }
2053
2065
  }
2054
- async function Lt(i) {
2055
- var y, U;
2056
- if (!r.value || !$.share) return;
2057
- const t = (y = i.project) == null ? void 0 : y.uuid;
2066
+ async function Ht(i) {
2067
+ var f, V;
2068
+ if (!o.value || !$.share) return;
2069
+ const t = (f = i.project) == null ? void 0 : f.uuid;
2058
2070
  if (t) {
2059
- P.value = "loading", T.value = "";
2071
+ A.value = "loading", L.value = "";
2060
2072
  try {
2061
- const Z = await $.share.updateArtifact(t, r.value);
2062
- Q.value = Z.url || "", w.value = null, B.value = !0, le.value = ((U = i.project) == null ? void 0 : U.name) || "Untitled", P.value = "success";
2063
- } catch (Z) {
2064
- T.value = Z.message || "Failed to update artifact", P.value = "error";
2073
+ const J = await $.share.updateArtifact(t, o.value);
2074
+ Q.value = J.url || "", w.value = null, E.value = !0, le.value = ((V = i.project) == null ? void 0 : V.name) || "Untitled", A.value = "success";
2075
+ } catch (J) {
2076
+ L.value = J.message || "Failed to update artifact", A.value = "error";
2065
2077
  }
2066
2078
  }
2067
2079
  }
2068
- async function Tt() {
2080
+ async function Bt() {
2069
2081
  if (Q.value)
2070
2082
  try {
2071
- await navigator.clipboard.writeText(Q.value), o.value = !0, setTimeout(() => {
2072
- o.value = !1;
2083
+ await navigator.clipboard.writeText(Q.value), r.value = !0, setTimeout(() => {
2084
+ r.value = !1;
2073
2085
  }, 2e3);
2074
2086
  } catch (i) {
2075
2087
  console.error("Failed to copy link:", i);
2076
2088
  }
2077
2089
  }
2078
- function Pt() {
2079
- A.value && window.open(A.value, "_blank");
2090
+ function Et() {
2091
+ P.value && window.open(P.value, "_blank");
2080
2092
  }
2081
- function At() {
2082
- Y.value && E.value && (Y.value.style.transform = `translateY(-${E.value.scrollTop}px)`);
2093
+ function St() {
2094
+ Y.value && S.value && (Y.value.style.transform = `translateY(-${S.value.scrollTop}px)`);
2083
2095
  }
2084
- function Ht() {
2085
- J.value = !J.value;
2096
+ function zt() {
2097
+ X.value = !X.value;
2086
2098
  }
2087
- function Ke(i) {
2088
- k.value = !0, F(i), J.value = !1;
2099
+ function Qe(i) {
2100
+ k.value = !0, F(i), X.value = !1;
2089
2101
  }
2090
- function St() {
2091
- const i = O.value - 1;
2092
- i >= 0 && F(u.value[i]);
2102
+ function It() {
2103
+ const i = U.value - 1;
2104
+ i >= 0 && F(d.value[i]);
2093
2105
  }
2094
- function Bt() {
2095
- const i = O.value + 1;
2096
- i < u.value.length && F(u.value[i]);
2106
+ function Ft() {
2107
+ const i = U.value + 1;
2108
+ i < d.value.length && F(d.value[i]);
2097
2109
  }
2098
- function Ye(i) {
2110
+ function Ge(i) {
2099
2111
  const t = document.querySelector(".artifactuse-panel__nav");
2100
- t && !t.contains(i.target) && (J.value = !1);
2112
+ t && !t.contains(i.target) && (X.value = !1);
2101
2113
  }
2102
2114
  let we = null;
2103
- function Et(i) {
2115
+ function Vt(i) {
2104
2116
  we = {
2105
2117
  startX: i.clientX,
2106
- startWidth: C.value
2107
- }, document.addEventListener("mousemove", Qe), document.addEventListener("mouseup", Fe), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((y) => y.style.pointerEvents = "none");
2118
+ startWidth: b.value
2119
+ }, document.addEventListener("mousemove", et), document.addEventListener("mouseup", Re), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((f) => f.style.pointerEvents = "none");
2108
2120
  }
2109
- function Qe(i) {
2121
+ function et(i) {
2110
2122
  if (!we) return;
2111
- const t = window.innerWidth, U = (we.startX - i.clientX) / t * 100, Z = we.startWidth + U;
2112
- C.value = Math.min(Math.max(Z, 25), 75), _("resize", { width: C.value });
2123
+ const t = window.innerWidth, V = (we.startX - i.clientX) / t * 100, J = we.startWidth + V;
2124
+ b.value = Math.min(Math.max(J, 25), 75), h("resize", { width: b.value });
2113
2125
  }
2114
- function Fe() {
2126
+ function Re() {
2115
2127
  const i = we !== null;
2116
- we = null, document.removeEventListener("mousemove", Qe), document.removeEventListener("mouseup", Fe), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((y) => y.style.pointerEvents = ""), i && _("resize", { width: C.value });
2128
+ we = null, document.removeEventListener("mousemove", et), document.removeEventListener("mouseup", Re), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((f) => f.style.pointerEvents = ""), i && h("resize", { width: b.value });
2117
2129
  }
2118
- let Me = null;
2119
- function zt(i) {
2130
+ let Te = null;
2131
+ function Rt(i) {
2120
2132
  if (!W.value) return;
2121
2133
  const t = W.value.getBoundingClientRect();
2122
- Me = {
2134
+ Te = {
2123
2135
  startX: i.clientX,
2124
2136
  startPosition: I.value,
2125
2137
  contentLeft: t.left,
2126
2138
  contentWidth: t.width
2127
- }, document.addEventListener("mousemove", Ge), document.addEventListener("mouseup", Ve), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((U) => U.style.pointerEvents = "none");
2139
+ }, document.addEventListener("mousemove", tt), document.addEventListener("mouseup", qe), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((V) => V.style.pointerEvents = "none");
2128
2140
  }
2129
- function Ge(i) {
2130
- if (!Me) return;
2131
- const y = (i.clientX - Me.contentLeft) / Me.contentWidth * 100;
2132
- I.value = Math.min(Math.max(y, 20), 80);
2141
+ function tt(i) {
2142
+ if (!Te) return;
2143
+ const f = (i.clientX - Te.contentLeft) / Te.contentWidth * 100;
2144
+ I.value = Math.min(Math.max(f, 20), 80);
2133
2145
  }
2134
- function Ve() {
2135
- Me = null, document.removeEventListener("mousemove", Ge), document.removeEventListener("mouseup", Ve), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((t) => t.style.pointerEvents = "");
2146
+ function qe() {
2147
+ Te = null, document.removeEventListener("mousemove", tt), document.removeEventListener("mouseup", qe), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((t) => t.style.pointerEvents = "");
2136
2148
  }
2137
- return de(r, (i, t) => {
2138
- i && (t && t.isPreviewable !== i.isPreviewable && (f.value = !0, setTimeout(() => {
2139
- f.value = !1;
2140
- }, 150)), (!t || i.id !== t.id) && (ht(), oe.value = !0, gt()), (!t || i.id !== t.id || i.code !== t.code) && (Te(), m.viewMode === "edit" && (!t || i.id !== t.id ? be(() => We()) : fe && fe.setCode(i.code || "")), clearTimeout(pe), pe = setTimeout(() => {
2149
+ return de(o, (i, t) => {
2150
+ i && (t && t.isPreviewable !== i.isPreviewable && (p.value = !0, setTimeout(() => {
2151
+ p.value = !1;
2152
+ }, 150)), (!t || i.id !== t.id) && (gt(), oe.value = !0, Ct()), (!t || i.id !== t.id || i.code !== t.code) && (Ae(), m.viewMode === "edit" && (!t || i.id !== t.id ? Ce(() => Xe()) : fe && fe.setCode(i.code || "")), clearTimeout(pe), pe = setTimeout(() => {
2141
2153
  j.value && i.isPreviewable && $.bridge.loadArtifact(i);
2142
2154
  }, 500)));
2143
2155
  }, { deep: !0 }), de(() => m.viewMode, (i) => {
2144
- (i === "code" || i === "split") && Te(), i === "edit" && be(() => We());
2156
+ (i === "code" || i === "split") && Ae(), i === "edit" && Ce(() => Xe());
2145
2157
  }), de(() => m.isPanelOpen, (i) => {
2146
- i && r.value && Te(), i || ze();
2147
- }), de(() => L.panelWidth, (i) => {
2148
- i !== void 0 && (C.value = Math.min(Math.max(i, 25), 75));
2149
- }), de(() => L.splitPosition, (i) => {
2158
+ i && o.value && Ae(), i || Fe();
2159
+ }), de(() => T.panelWidth, (i) => {
2160
+ i !== void 0 && (b.value = Math.min(Math.max(i, 25), 75));
2161
+ }), de(() => T.splitPosition, (i) => {
2150
2162
  i !== void 0 && (I.value = Math.min(Math.max(i, 20), 80));
2151
2163
  }), $e(() => {
2152
- $.on("ai:request", (i) => _("ai-request", i)), $.on("save:request", (i) => _("save", i)), $.on("export:complete", (i) => _("export", i)), document.addEventListener("click", Ye), m.isPanelOpen && r.value && Te();
2153
- }), De(() => {
2154
- Fe(), Ve(), ze(), document.removeEventListener("click", Ye), clearTimeout(pe), clearTimeout(ye);
2155
- }), (i, t) => (a(), xe(Ae, { name: "artifactuse-panel" }, {
2156
- default: He(() => [
2164
+ $.on("ai:request", (i) => h("ai-request", i)), $.on("save:request", (i) => h("save", i)), $.on("export:complete", (i) => h("export", i)), document.addEventListener("click", Ge), m.isPanelOpen && o.value && Ae();
2165
+ }), Ne(() => {
2166
+ Re(), qe(), Fe(), document.removeEventListener("click", Ge), clearTimeout(pe), clearTimeout(ye);
2167
+ }), (i, t) => (a(), xe(He, { name: "artifactuse-panel" }, {
2168
+ default: Be(() => [
2157
2169
  g(m).isPanelOpen ? (a(), s("div", {
2158
2170
  key: 0,
2159
2171
  class: N(["artifactuse-panel", {
2160
2172
  "artifactuse-panel--fullscreen": g(m).isFullscreen,
2161
- "artifactuse-panel--list": !g(r) && g(S),
2162
- "artifactuse-panel--empty": !g(S)
2173
+ "artifactuse-panel--list": !g(o) && g(B),
2174
+ "artifactuse-panel--empty": !g(B)
2163
2175
  }]),
2164
- style: Pe(g(m).isFullscreen ? void 0 : { width: `${ut.value}%` })
2176
+ style: Pe(g(m).isFullscreen ? void 0 : { width: `${vt.value}%` })
2165
2177
  }, [
2166
2178
  g(m).isFullscreen ? v("", !0) : (a(), s("div", {
2167
2179
  key: 0,
2168
2180
  class: "artifactuse-panel__resize-handle",
2169
- onMousedown: me(Et, ["prevent"])
2181
+ onMousedown: he(Vt, ["prevent"])
2170
2182
  }, [...t[12] || (t[12] = [
2171
2183
  e("div", { class: "artifactuse-panel__resize-handle-line" }, null, -1)
2172
2184
  ])], 32)),
2173
- g(S) ? g(r) ? (a(), s(R, { key: 3 }, [
2174
- e("header", Ll, [
2175
- k.value ? (a(), s("button", {
2185
+ g(B) ? g(o) ? (a(), s(R, { key: 3 }, [
2186
+ e("header", Hl, [
2187
+ Me.value || k.value ? (a(), s("button", {
2176
2188
  key: 0,
2177
2189
  class: "artifactuse-panel__back",
2178
- title: "Back to list",
2179
- onClick: dt
2190
+ title: Me.value ? "Browse artifacts" : "Back to list",
2191
+ onClick: _t
2180
2192
  }, [...t[24] || (t[24] = [
2181
2193
  e("svg", {
2182
2194
  viewBox: "0 0 24 24",
@@ -2186,29 +2198,29 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2186
2198
  }, [
2187
2199
  e("polyline", { points: "15 18 9 12 15 6" })
2188
2200
  ], -1)
2189
- ])])) : v("", !0),
2190
- e("div", Tl, [
2201
+ ])], 8, Bl)) : v("", !0),
2202
+ e("div", El, [
2191
2203
  e("span", {
2192
2204
  class: "artifactuse-panel__icon",
2193
2205
  innerHTML: te.value
2194
- }, null, 8, Pl),
2195
- e("div", Al, [
2196
- e("span", Hl, l(g(r).title || "Untitled"), 1),
2197
- e("span", Sl, [
2198
- K(l(D.value) + " ", 1),
2199
- g(r).lineCount ? (a(), s(R, { key: 0 }, [
2200
- K(" • " + l(g(r).lineCount) + " lines ", 1)
2206
+ }, null, 8, Sl),
2207
+ e("div", zl, [
2208
+ e("span", Il, n(g(o).title || "Untitled"), 1),
2209
+ e("span", Fl, [
2210
+ K(n(D.value) + " ", 1),
2211
+ g(o).lineCount ? (a(), s(R, { key: 0 }, [
2212
+ K(" • " + n(g(o).lineCount) + " lines ", 1)
2201
2213
  ], 64)) : v("", !0)
2202
2214
  ])
2203
2215
  ])
2204
2216
  ]),
2205
- e("div", Bl, [
2206
- !g(r).tabs || g(r).tabs.includes("preview") ? (a(), s("button", {
2217
+ e("div", Vl, [
2218
+ !g(o).tabs || g(o).tabs.includes("preview") ? (a(), s("button", {
2207
2219
  key: 0,
2208
2220
  class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": g(m).viewMode === "preview" }]),
2209
- disabled: !g(r).isPreviewable,
2221
+ disabled: !g(o).isPreviewable,
2210
2222
  title: "Preview",
2211
- onClick: t[2] || (t[2] = (y) => g(p)("preview"))
2223
+ onClick: t[2] || (t[2] = (f) => g(_)("preview"))
2212
2224
  }, [...t[25] || (t[25] = [
2213
2225
  e("svg", {
2214
2226
  viewBox: "0 0 24 24",
@@ -2223,12 +2235,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2223
2235
  r: "3"
2224
2236
  })
2225
2237
  ], -1)
2226
- ])], 10, El)) : v("", !0),
2227
- !g(r).tabs || g(r).tabs.includes("code") ? (a(), s("button", {
2238
+ ])], 10, Rl)) : v("", !0),
2239
+ !g(o).tabs || g(o).tabs.includes("code") ? (a(), s("button", {
2228
2240
  key: 1,
2229
2241
  class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": g(m).viewMode === "code" }]),
2230
2242
  title: "Code",
2231
- onClick: t[3] || (t[3] = (y) => g(p)("code"))
2243
+ onClick: t[3] || (t[3] = (f) => g(_)("code"))
2232
2244
  }, [...t[26] || (t[26] = [
2233
2245
  e("svg", {
2234
2246
  viewBox: "0 0 24 24",
@@ -2240,12 +2252,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2240
2252
  e("polyline", { points: "8 6 2 12 8 18" })
2241
2253
  ], -1)
2242
2254
  ])], 2)) : v("", !0),
2243
- !g(r).tabs || g(r).tabs.includes("split") ? (a(), s("button", {
2255
+ !g(o).tabs || g(o).tabs.includes("split") ? (a(), s("button", {
2244
2256
  key: 2,
2245
2257
  class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": g(m).viewMode === "split" }]),
2246
- disabled: !g(r).isPreviewable,
2258
+ disabled: !g(o).isPreviewable,
2247
2259
  title: "Split view",
2248
- onClick: t[4] || (t[4] = (y) => g(p)("split"))
2260
+ onClick: t[4] || (t[4] = (f) => g(_)("split"))
2249
2261
  }, [...t[27] || (t[27] = [
2250
2262
  e("svg", {
2251
2263
  viewBox: "0 0 24 24",
@@ -2268,12 +2280,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2268
2280
  y2: "21"
2269
2281
  })
2270
2282
  ], -1)
2271
- ])], 10, zl)) : v("", !0),
2272
- g(r).tabs && g(r).tabs.includes("edit") && Le.value ? (a(), s("button", {
2283
+ ])], 10, ql)) : v("", !0),
2284
+ g(o).tabs && g(o).tabs.includes("edit") && Le.value ? (a(), s("button", {
2273
2285
  key: 3,
2274
2286
  class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": g(m).viewMode === "edit" }]),
2275
2287
  title: "Edit",
2276
- onClick: t[5] || (t[5] = (y) => g(p)("edit"))
2288
+ onClick: t[5] || (t[5] = (f) => g(_)("edit"))
2277
2289
  }, [...t[28] || (t[28] = [
2278
2290
  e("svg", {
2279
2291
  viewBox: "0 0 24 24",
@@ -2286,12 +2298,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2286
2298
  ], -1)
2287
2299
  ])], 2)) : v("", !0)
2288
2300
  ]),
2289
- e("div", Il, [
2301
+ e("div", Ol, [
2290
2302
  g(m).viewMode === "edit" ? (a(), s("button", {
2291
2303
  key: 0,
2292
2304
  class: "artifactuse-panel__action artifactuse-panel__action--save",
2293
2305
  title: "Save",
2294
- onClick: _t
2306
+ onClick: kt
2295
2307
  }, [...t[29] || (t[29] = [
2296
2308
  e("svg", {
2297
2309
  viewBox: "0 0 24 24",
@@ -2307,9 +2319,9 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2307
2319
  e("button", {
2308
2320
  class: "artifactuse-panel__action",
2309
2321
  title: g(m).isFullscreen ? "Exit fullscreen" : "Fullscreen",
2310
- onClick: t[6] || (t[6] = (...y) => g(n) && g(n)(...y))
2322
+ onClick: t[6] || (t[6] = (...f) => g(l) && g(l)(...f))
2311
2323
  }, [
2312
- g(m).isFullscreen ? (a(), s("svg", Rl, [...t[31] || (t[31] = [
2324
+ g(m).isFullscreen ? (a(), s("svg", jl, [...t[31] || (t[31] = [
2313
2325
  e("polyline", { points: "4 14 10 14 10 20" }, null, -1),
2314
2326
  e("polyline", { points: "20 10 14 10 14 4" }, null, -1),
2315
2327
  e("line", {
@@ -2324,7 +2336,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2324
2336
  x2: "10",
2325
2337
  y2: "14"
2326
2338
  }, null, -1)
2327
- ])])) : (a(), s("svg", Vl, [...t[30] || (t[30] = [
2339
+ ])])) : (a(), s("svg", Dl, [...t[30] || (t[30] = [
2328
2340
  e("polyline", { points: "15 3 21 3 21 9" }, null, -1),
2329
2341
  e("polyline", { points: "9 21 3 21 3 15" }, null, -1),
2330
2342
  e("line", {
@@ -2340,11 +2352,11 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2340
2352
  y2: "14"
2341
2353
  }, null, -1)
2342
2354
  ])]))
2343
- ], 8, Fl),
2355
+ ], 8, Ul),
2344
2356
  e("button", {
2345
2357
  class: "artifactuse-panel__action artifactuse-panel__action--close",
2346
2358
  title: "Close panel",
2347
- onClick: t[7] || (t[7] = (...y) => g(h) && g(h)(...y))
2359
+ onClick: t[7] || (t[7] = (...f) => g(y) && g(y)(...f))
2348
2360
  }, [...t[32] || (t[32] = [
2349
2361
  e("svg", {
2350
2362
  viewBox: "0 0 24 24",
@@ -2368,15 +2380,58 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2368
2380
  ])])
2369
2381
  ])
2370
2382
  ]),
2383
+ Me.value && We.value.length > 0 ? (a(), s("div", Nl, [
2384
+ e("div", Wl, [
2385
+ (a(!0), s(R, null, ve(We.value, (f) => {
2386
+ var V;
2387
+ return a(), s("button", {
2388
+ key: f.id,
2389
+ class: N(["artifactuse-panel__file-tab", { "artifactuse-panel__file-tab--active": f.id === ((V = g(o)) == null ? void 0 : V.id) }]),
2390
+ onClick: (J) => ft(f)
2391
+ }, [
2392
+ e("span", {
2393
+ class: "artifactuse-panel__file-tab-icon",
2394
+ innerHTML: Ie(f.language)
2395
+ }, null, 8, Xl),
2396
+ e("span", Zl, n(f.title || "Untitled"), 1),
2397
+ e("button", {
2398
+ class: "artifactuse-panel__file-tab-close",
2399
+ title: "Close tab",
2400
+ onClick: he((J) => pt(f.id), ["stop"])
2401
+ }, [...t[33] || (t[33] = [
2402
+ e("svg", {
2403
+ viewBox: "0 0 24 24",
2404
+ fill: "none",
2405
+ stroke: "currentColor",
2406
+ "stroke-width": "2"
2407
+ }, [
2408
+ e("line", {
2409
+ x1: "18",
2410
+ y1: "6",
2411
+ x2: "6",
2412
+ y2: "18"
2413
+ }),
2414
+ e("line", {
2415
+ x1: "6",
2416
+ y1: "6",
2417
+ x2: "18",
2418
+ y2: "18"
2419
+ })
2420
+ ], -1)
2421
+ ])], 8, Kl)
2422
+ ], 10, Jl);
2423
+ }), 128))
2424
+ ])
2425
+ ])) : v("", !0),
2371
2426
  e("div", {
2372
2427
  ref_key: "contentRef",
2373
2428
  ref: W,
2374
2429
  class: N(["artifactuse-panel__content", [
2375
2430
  `artifactuse-panel__content--${g(m).viewMode}`,
2376
- { "artifactuse-panel__content--transitioning": f.value }
2431
+ { "artifactuse-panel__content--transitioning": p.value }
2377
2432
  ]])
2378
2433
  }, [
2379
- f.value ? (a(), s("div", ql, [...t[33] || (t[33] = [
2434
+ p.value ? (a(), s("div", Yl, [...t[34] || (t[34] = [
2380
2435
  e("div", { class: "artifactuse-panel__spinner" }, null, -1)
2381
2436
  ])])) : v("", !0),
2382
2437
  g(m).viewMode === "preview" || g(m).viewMode === "split" ? (a(), s("div", {
@@ -2384,21 +2439,21 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2384
2439
  class: "artifactuse-panel__preview",
2385
2440
  style: Pe(g(m).viewMode === "split" ? { width: `${I.value}%` } : void 0)
2386
2441
  }, [
2387
- oe.value && A.value ? (a(), s("div", Ol, [...t[34] || (t[34] = [
2442
+ oe.value && P.value ? (a(), s("div", Ql, [...t[35] || (t[35] = [
2388
2443
  e("div", { class: "artifactuse-panel__spinner" }, null, -1)
2389
2444
  ])])) : v("", !0),
2390
- A.value ? (a(), s("iframe", {
2445
+ P.value ? (a(), s("iframe", {
2391
2446
  key: 1,
2392
2447
  ref_key: "iframeRef",
2393
2448
  ref: j,
2394
- src: A.value,
2449
+ src: P.value,
2395
2450
  class: N(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": oe.value }]),
2396
2451
  sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
2397
2452
  allow: "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write",
2398
- onLoad: mt,
2399
- onError: yt
2400
- }, null, 42, Ul)) : (a(), s("div", Dl, [
2401
- t[35] || (t[35] = e("svg", {
2453
+ onLoad: wt,
2454
+ onError: bt
2455
+ }, null, 42, Gl)) : (a(), s("div", en, [
2456
+ t[36] || (t[36] = e("svg", {
2402
2457
  viewBox: "0 0 24 24",
2403
2458
  fill: "none",
2404
2459
  stroke: "currentColor",
@@ -2413,25 +2468,25 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2413
2468
  y2: "12"
2414
2469
  })
2415
2470
  ], -1)),
2416
- e("p", null, "Preview not available for " + l(D.value), 1)
2471
+ e("p", null, "Preview not available for " + n(D.value), 1)
2417
2472
  ]))
2418
2473
  ], 4)) : v("", !0),
2419
- at(e("div", {
2474
+ it(e("div", {
2420
2475
  class: "artifactuse-panel__code",
2421
2476
  style: Pe(g(m).viewMode === "split" ? { width: `${100 - I.value}%` } : void 0)
2422
2477
  }, [
2423
2478
  g(m).viewMode === "split" ? (a(), s("div", {
2424
2479
  key: 0,
2425
2480
  class: "artifactuse-panel__split-handle",
2426
- onMousedown: me(zt, ["prevent"])
2427
- }, [...t[36] || (t[36] = [
2481
+ onMousedown: he(Rt, ["prevent"])
2482
+ }, [...t[37] || (t[37] = [
2428
2483
  e("div", { class: "artifactuse-panel__split-handle-line" }, null, -1)
2429
2484
  ])], 32)) : v("", !0),
2430
2485
  e("div", {
2431
2486
  class: "artifactuse-panel__code-scroll",
2432
2487
  ref_key: "codeScrollRef",
2433
- ref: E,
2434
- onScroll: At
2488
+ ref: S,
2489
+ onScroll: St
2435
2490
  }, [
2436
2491
  e("div", {
2437
2492
  class: "artifactuse-panel__line-numbers",
@@ -2443,28 +2498,28 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2443
2498
  }, [
2444
2499
  (a(), s("code", {
2445
2500
  ref_key: "codeRef",
2446
- ref: q,
2447
- key: g(r).id,
2501
+ ref: O,
2502
+ key: g(o).id,
2448
2503
  class: N(`language-${ae.value}`)
2449
2504
  }, null, 2))
2450
2505
  ], 2)
2451
2506
  ], 544)
2452
2507
  ], 4), [
2453
- [st, g(m).viewMode === "code" || g(m).viewMode === "split"]
2508
+ [lt, g(m).viewMode === "code" || g(m).viewMode === "split"]
2454
2509
  ]),
2455
- at(e("div", jl, [
2510
+ it(e("div", tn, [
2456
2511
  e("div", {
2457
2512
  ref_key: "editorContainerRef",
2458
2513
  ref: ie,
2459
2514
  class: "artifactuse-panel__editor-container"
2460
2515
  }, null, 512)
2461
2516
  ], 512), [
2462
- [st, g(m).viewMode === "edit"]
2517
+ [lt, g(m).viewMode === "edit"]
2463
2518
  ])
2464
2519
  ], 2),
2465
- e("footer", Nl, [
2466
- e("div", Wl, [
2467
- G.value ? (a(), s("a", Jl, [...t[37] || (t[37] = [
2520
+ e("footer", an, [
2521
+ e("div", sn, [
2522
+ G.value ? (a(), s("a", ln, [...t[38] || (t[38] = [
2468
2523
  e("svg", {
2469
2524
  width: "16",
2470
2525
  height: "16",
@@ -2483,17 +2538,17 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2483
2538
  ], -1),
2484
2539
  e("span", null, "Artifactuse", -1)
2485
2540
  ])])) : v("", !0),
2486
- g(r).size ? (a(), s("span", Xl, l(g(nt)(g(r).size)), 1)) : v("", !0)
2541
+ g(o).size ? (a(), s("span", nn, n(g(rt)(g(o).size)), 1)) : v("", !0)
2487
2542
  ]),
2488
- e("div", Zl, [
2543
+ e("div", on, [
2489
2544
  e("button", {
2490
- class: N(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success": X.value }]),
2491
- title: X.value ? "Copied!" : "Copy code",
2492
- onClick: kt
2545
+ class: N(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success": Z.value }]),
2546
+ title: Z.value ? "Copied!" : "Copy code",
2547
+ onClick: xt
2493
2548
  }, [
2494
- X.value ? (a(), s("svg", Ql, [...t[39] || (t[39] = [
2549
+ Z.value ? (a(), s("svg", un, [...t[40] || (t[40] = [
2495
2550
  e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
2496
- ])])) : (a(), s("svg", Yl, [...t[38] || (t[38] = [
2551
+ ])])) : (a(), s("svg", cn, [...t[39] || (t[39] = [
2497
2552
  e("rect", {
2498
2553
  x: "9",
2499
2554
  y: "9",
@@ -2504,12 +2559,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2504
2559
  }, null, -1),
2505
2560
  e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
2506
2561
  ])]))
2507
- ], 10, Kl),
2562
+ ], 10, rn),
2508
2563
  e("button", {
2509
2564
  class: "artifactuse-panel__footer-action",
2510
2565
  title: "Download file",
2511
- onClick: wt
2512
- }, [...t[40] || (t[40] = [
2566
+ onClick: $t
2567
+ }, [...t[41] || (t[41] = [
2513
2568
  e("svg", {
2514
2569
  viewBox: "0 0 24 24",
2515
2570
  fill: "none",
@@ -2526,12 +2581,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2526
2581
  })
2527
2582
  ], -1)
2528
2583
  ])]),
2529
- ce.value ? (a(), s("div", Gl, [
2584
+ ce.value ? (a(), s("div", dn, [
2530
2585
  e("button", {
2531
2586
  class: "artifactuse-panel__footer-action",
2532
2587
  title: "Share",
2533
- onClick: bt
2534
- }, [...t[41] || (t[41] = [
2588
+ onClick: Tt
2589
+ }, [...t[42] || (t[42] = [
2535
2590
  e("svg", {
2536
2591
  viewBox: "0 0 24 24",
2537
2592
  fill: "none",
@@ -2567,15 +2622,15 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2567
2622
  })
2568
2623
  ], -1)
2569
2624
  ])]),
2570
- Be(Ae, { name: "artifactuse-popup" }, {
2571
- default: He(() => [
2572
- re.value ? (a(), s("div", en, [
2573
- e("div", tn, [
2574
- e("span", an, l(P.value === "success" ? le.value ? "Artifact updated!" : "Link created!" : P.value === "update-list" ? "Update saved artifact" : "Share Artifact"), 1),
2625
+ Se(He, { name: "artifactuse-popup" }, {
2626
+ default: Be(() => [
2627
+ re.value ? (a(), s("div", vn, [
2628
+ e("div", fn, [
2629
+ e("span", pn, n(A.value === "success" ? le.value ? "Artifact updated!" : "Link created!" : A.value === "update-list" ? "Update saved artifact" : "Share Artifact"), 1),
2575
2630
  e("button", {
2576
2631
  class: "artifactuse-share-popup__close",
2577
- onClick: xt
2578
- }, [...t[42] || (t[42] = [
2632
+ onClick: Lt
2633
+ }, [...t[43] || (t[43] = [
2579
2634
  e("svg", {
2580
2635
  viewBox: "0 0 24 24",
2581
2636
  fill: "none",
@@ -2597,29 +2652,29 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2597
2652
  ], -1)
2598
2653
  ])])
2599
2654
  ]),
2600
- e("div", sn, [
2601
- P.value === "loading" ? (a(), s("div", ln, [...t[43] || (t[43] = [
2655
+ e("div", _n, [
2656
+ A.value === "loading" ? (a(), s("div", hn, [...t[44] || (t[44] = [
2602
2657
  e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
2603
2658
  e("p", { class: "artifactuse-share-popup__loading-text" }, "Creating link...", -1)
2604
- ])])) : P.value === "error" ? (a(), s("div", nn, [
2605
- e("div", on, [
2606
- e("p", rn, l(T.value), 1)
2659
+ ])])) : A.value === "error" ? (a(), s("div", mn, [
2660
+ e("div", yn, [
2661
+ e("p", gn, n(L.value), 1)
2607
2662
  ]),
2608
- e("div", cn, [
2663
+ e("div", kn, [
2609
2664
  e("button", {
2610
2665
  class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--secondary",
2611
- onClick: t[8] || (t[8] = (y) => P.value = "options")
2666
+ onClick: t[8] || (t[8] = (f) => A.value = "options")
2612
2667
  }, " Back "),
2613
2668
  e("button", {
2614
2669
  class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--primary",
2615
- onClick: $t
2670
+ onClick: At
2616
2671
  }, " Retry ")
2617
2672
  ])
2618
- ])) : P.value === "options" ? (a(), s("div", un, [
2673
+ ])) : A.value === "options" ? (a(), s("div", wn, [
2619
2674
  e("button", {
2620
2675
  class: "artifactuse-share-popup__option",
2621
- onClick: Xe
2622
- }, [...t[44] || (t[44] = [
2676
+ onClick: Ke
2677
+ }, [...t[45] || (t[45] = [
2623
2678
  e("div", { class: "artifactuse-share-popup__option-icon" }, [
2624
2679
  e("svg", {
2625
2680
  viewBox: "0 0 24 24",
@@ -2638,8 +2693,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2638
2693
  ])]),
2639
2694
  e("button", {
2640
2695
  class: "artifactuse-share-popup__option",
2641
- onClick: Ze
2642
- }, [...t[45] || (t[45] = [
2696
+ onClick: Ye
2697
+ }, [...t[46] || (t[46] = [
2643
2698
  e("div", { class: "artifactuse-share-popup__option-icon" }, [
2644
2699
  e("svg", {
2645
2700
  viewBox: "0 0 24 24",
@@ -2659,8 +2714,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2659
2714
  ])]),
2660
2715
  e("button", {
2661
2716
  class: "artifactuse-share-popup__option",
2662
- onClick: Mt
2663
- }, [...t[46] || (t[46] = [
2717
+ onClick: Pt
2718
+ }, [...t[47] || (t[47] = [
2664
2719
  e("div", { class: "artifactuse-share-popup__option-icon" }, [
2665
2720
  e("svg", {
2666
2721
  viewBox: "0 0 24 24",
@@ -2678,29 +2733,29 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2678
2733
  e("p", { class: "artifactuse-share-popup__option-desc" }, "Replace an existing artifact")
2679
2734
  ], -1)
2680
2735
  ])])
2681
- ])) : P.value === "update-list" ? (a(), s("div", dn, [
2682
- z.value ? (a(), s("div", vn, [...t[47] || (t[47] = [
2736
+ ])) : A.value === "update-list" ? (a(), s("div", bn, [
2737
+ z.value ? (a(), s("div", Cn, [...t[48] || (t[48] = [
2683
2738
  e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
2684
2739
  e("p", { class: "artifactuse-share-popup__loading-text" }, "Loading artifacts...", -1)
2685
- ])])) : c.value.length === 0 ? (a(), s("div", fn, " No saved artifacts of this type ")) : (a(), s("div", pn, [
2686
- (a(!0), s(R, null, ve(c.value, (y) => {
2687
- var U, Z, _e;
2740
+ ])])) : u.value.length === 0 ? (a(), s("div", xn, " No saved artifacts of this type ")) : (a(), s("div", $n, [
2741
+ (a(!0), s(R, null, ve(u.value, (f) => {
2742
+ var V, J, me;
2688
2743
  return a(), s("button", {
2689
- key: ((U = y.project) == null ? void 0 : U.uuid) || y.id,
2744
+ key: ((V = f.project) == null ? void 0 : V.uuid) || f.id,
2690
2745
  class: "artifactuse-share-popup__artifact-item",
2691
- onClick: (ue) => Lt(y)
2746
+ onClick: (ue) => Ht(f)
2692
2747
  }, [
2693
- e("span", _n, l(((Z = y.project) == null ? void 0 : Z.name) || "Untitled"), 1),
2694
- e("span", mn, l(Je((_e = y.project) == null ? void 0 : _e.created_at)), 1)
2695
- ], 8, hn);
2748
+ e("span", Tn, n(((J = f.project) == null ? void 0 : J.name) || "Untitled"), 1),
2749
+ e("span", Ln, n(Ze((me = f.project) == null ? void 0 : me.created_at)), 1)
2750
+ ], 8, Mn);
2696
2751
  }), 128))
2697
2752
  ])),
2698
2753
  e("button", {
2699
2754
  class: "artifactuse-share-popup__back-btn",
2700
- onClick: t[9] || (t[9] = (y) => P.value = "options")
2755
+ onClick: t[9] || (t[9] = (f) => A.value = "options")
2701
2756
  }, "Back")
2702
- ])) : P.value === "success" ? (a(), s("div", yn, [
2703
- t[50] || (t[50] = e("div", { class: "artifactuse-share-popup__success-icon" }, [
2757
+ ])) : A.value === "success" ? (a(), s("div", An, [
2758
+ t[51] || (t[51] = e("div", { class: "artifactuse-share-popup__success-icon" }, [
2704
2759
  e("svg", {
2705
2760
  viewBox: "0 0 24 24",
2706
2761
  fill: "none",
@@ -2710,21 +2765,21 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2710
2765
  e("polyline", { points: "20 6 9 17 4 12" })
2711
2766
  ])
2712
2767
  ], -1)),
2713
- e("div", gn, [
2768
+ e("div", Pn, [
2714
2769
  e("input", {
2715
2770
  type: "text",
2716
2771
  class: "artifactuse-share-popup__link",
2717
2772
  value: Q.value,
2718
2773
  readonly: "",
2719
- onClick: t[10] || (t[10] = (y) => y.target.select())
2720
- }, null, 8, kn),
2774
+ onClick: t[10] || (t[10] = (f) => f.target.select())
2775
+ }, null, 8, Hn),
2721
2776
  e("button", {
2722
- class: N(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied": o.value }]),
2723
- onClick: Tt
2724
- }, l(o.value ? "Copied!" : "Copy"), 3)
2777
+ class: N(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied": r.value }]),
2778
+ onClick: Bt
2779
+ }, n(r.value ? "Copied!" : "Copy"), 3)
2725
2780
  ]),
2726
- w.value && !B.value ? (a(), s("div", wn, [
2727
- t[48] || (t[48] = e("span", { class: "artifactuse-share-popup__expiry-icon" }, [
2781
+ w.value && !E.value ? (a(), s("div", Bn, [
2782
+ t[49] || (t[49] = e("span", { class: "artifactuse-share-popup__expiry-icon" }, [
2728
2783
  e("svg", {
2729
2784
  viewBox: "0 0 24 24",
2730
2785
  fill: "none",
@@ -2750,18 +2805,18 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2750
2805
  })
2751
2806
  ])
2752
2807
  ], -1)),
2753
- e("span", Cn, " Expires " + l(Je(w.value)), 1)
2808
+ e("span", En, " Expires " + n(Ze(w.value)), 1)
2754
2809
  ])) : v("", !0),
2755
- B.value ? v("", !0) : (a(), s("div", bn, [
2756
- t[49] || (t[49] = e("p", { class: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?", -1)),
2810
+ E.value ? v("", !0) : (a(), s("div", Sn, [
2811
+ t[50] || (t[50] = e("p", { class: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?", -1)),
2757
2812
  e("button", {
2758
2813
  class: "artifactuse-share-popup__save-prompt-btn",
2759
- onClick: Ze
2814
+ onClick: Ye
2760
2815
  }, " Save to account ")
2761
2816
  ]))
2762
2817
  ])) : v("", !0)
2763
2818
  ]),
2764
- t[51] || (t[51] = e("div", { class: "artifactuse-share-popup__footer" }, [
2819
+ t[52] || (t[52] = e("div", { class: "artifactuse-share-popup__footer" }, [
2765
2820
  e("a", {
2766
2821
  href: "https://artifactuse.com",
2767
2822
  target: "_blank",
@@ -2792,12 +2847,12 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2792
2847
  _: 1
2793
2848
  })
2794
2849
  ])) : v("", !0),
2795
- A.value ? (a(), s("button", {
2850
+ P.value ? (a(), s("button", {
2796
2851
  key: 1,
2797
2852
  class: "artifactuse-panel__footer-action",
2798
2853
  title: "Open in new tab",
2799
- onClick: Pt
2800
- }, [...t[52] || (t[52] = [
2854
+ onClick: Et
2855
+ }, [...t[53] || (t[53] = [
2801
2856
  e("svg", {
2802
2857
  viewBox: "0 0 24 24",
2803
2858
  fill: "none",
@@ -2814,13 +2869,13 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2814
2869
  })
2815
2870
  ], -1)
2816
2871
  ])])) : v("", !0),
2817
- u.value.length > 1 ? (a(), s("div", xn, [
2872
+ !Me.value && d.value.length > 1 ? (a(), s("div", zn, [
2818
2873
  e("button", {
2819
2874
  class: "artifactuse-panel__nav-btn",
2820
- disabled: O.value <= 0,
2875
+ disabled: U.value <= 0,
2821
2876
  title: "Previous artifact",
2822
- onClick: St
2823
- }, [...t[53] || (t[53] = [
2877
+ onClick: It
2878
+ }, [...t[54] || (t[54] = [
2824
2879
  e("svg", {
2825
2880
  viewBox: "0 0 24 24",
2826
2881
  fill: "none",
@@ -2829,14 +2884,14 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2829
2884
  }, [
2830
2885
  e("polyline", { points: "15 18 9 12 15 6" })
2831
2886
  ], -1)
2832
- ])], 8, $n),
2887
+ ])], 8, In),
2833
2888
  e("button", {
2834
2889
  class: "artifactuse-panel__nav-trigger",
2835
2890
  title: "View all artifacts",
2836
- onClick: Ht
2891
+ onClick: zt
2837
2892
  }, [
2838
- e("span", null, l(O.value + 1) + " / " + l(u.value.length), 1),
2839
- t[54] || (t[54] = e("svg", {
2893
+ e("span", null, n(U.value + 1) + " / " + n(d.value.length), 1),
2894
+ t[55] || (t[55] = e("svg", {
2840
2895
  viewBox: "0 0 24 24",
2841
2896
  fill: "none",
2842
2897
  stroke: "currentColor",
@@ -2847,10 +2902,10 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2847
2902
  ]),
2848
2903
  e("button", {
2849
2904
  class: "artifactuse-panel__nav-btn",
2850
- disabled: O.value >= u.value.length - 1,
2905
+ disabled: U.value >= d.value.length - 1,
2851
2906
  title: "Next artifact",
2852
- onClick: Bt
2853
- }, [...t[55] || (t[55] = [
2907
+ onClick: Ft
2908
+ }, [...t[56] || (t[56] = [
2854
2909
  e("svg", {
2855
2910
  viewBox: "0 0 24 24",
2856
2911
  fill: "none",
@@ -2859,16 +2914,16 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2859
2914
  }, [
2860
2915
  e("polyline", { points: "9 18 15 12 9 6" })
2861
2916
  ], -1)
2862
- ])], 8, Mn),
2863
- Be(Ae, { name: "artifactuse-popup" }, {
2864
- default: He(() => [
2865
- J.value ? (a(), s("div", Ln, [
2866
- e("div", Tn, [
2867
- t[57] || (t[57] = e("span", null, "Artifacts", -1)),
2917
+ ])], 8, Fn),
2918
+ Se(He, { name: "artifactuse-popup" }, {
2919
+ default: Be(() => [
2920
+ X.value ? (a(), s("div", Vn, [
2921
+ e("div", Rn, [
2922
+ t[58] || (t[58] = e("span", null, "Artifacts", -1)),
2868
2923
  e("button", {
2869
2924
  class: "artifactuse-panel__artifact-list-close",
2870
- onClick: t[11] || (t[11] = (y) => J.value = !1)
2871
- }, [...t[56] || (t[56] = [
2925
+ onClick: t[11] || (t[11] = (f) => X.value = !1)
2926
+ }, [...t[57] || (t[57] = [
2872
2927
  e("svg", {
2873
2928
  viewBox: "0 0 24 24",
2874
2929
  fill: "none",
@@ -2890,27 +2945,27 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2890
2945
  ], -1)
2891
2946
  ])])
2892
2947
  ]),
2893
- e("div", Pn, [
2894
- (a(!0), s(R, null, ve(u.value, (y, U) => (a(), s("button", {
2895
- key: y.id,
2896
- class: N(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": y.id === g(r).id }]),
2897
- onClick: (Z) => Ke(y)
2948
+ e("div", qn, [
2949
+ (a(!0), s(R, null, ve(d.value, (f, V) => (a(), s("button", {
2950
+ key: f.id,
2951
+ class: N(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": f.id === g(o).id }]),
2952
+ onClick: (J) => Qe(f)
2898
2953
  }, [
2899
2954
  e("span", {
2900
2955
  class: "artifactuse-panel__artifact-item-icon",
2901
- innerHTML: je(y.language)
2902
- }, null, 8, Hn),
2903
- e("div", Sn, [
2904
- e("span", Bn, l(y.title || "Untitled"), 1),
2905
- e("span", En, [
2906
- K(l(g(Se)(y.language)) + " ", 1),
2907
- y.lineCount ? (a(), s(R, { key: 0 }, [
2908
- K(" • " + l(y.lineCount) + " lines ", 1)
2956
+ innerHTML: Ie(f.language)
2957
+ }, null, 8, Un),
2958
+ e("div", Dn, [
2959
+ e("span", jn, n(f.title || "Untitled"), 1),
2960
+ e("span", Nn, [
2961
+ K(n(g(Ee)(f.language)) + " ", 1),
2962
+ f.lineCount ? (a(), s(R, { key: 0 }, [
2963
+ K(" • " + n(f.lineCount) + " lines ", 1)
2909
2964
  ], 64)) : v("", !0)
2910
2965
  ])
2911
2966
  ]),
2912
- e("span", zn, l(U + 1), 1)
2913
- ], 10, An))), 128))
2967
+ e("span", Wn, n(V + 1), 1)
2968
+ ], 10, On))), 128))
2914
2969
  ])
2915
2970
  ])) : v("", !0)
2916
2971
  ]),
@@ -2920,8 +2975,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2920
2975
  ])
2921
2976
  ])
2922
2977
  ], 64)) : (a(), s(R, { key: 2 }, [
2923
- e("header", ul, [
2924
- e("div", dl, [
2978
+ e("header", pl, [
2979
+ e("div", _l, [
2925
2980
  t[18] || (t[18] = e("span", { class: "artifactuse-panel__icon" }, [
2926
2981
  e("svg", {
2927
2982
  viewBox: "0 0 24 24",
@@ -2933,19 +2988,19 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2933
2988
  e("polyline", { points: "8 6 2 12 8 18" })
2934
2989
  ])
2935
2990
  ], -1)),
2936
- e("div", vl, [
2991
+ e("div", hl, [
2937
2992
  t[17] || (t[17] = e("span", { class: "artifactuse-panel__name" }, "Artifacts", -1)),
2938
- e("span", fl, l(u.value.length) + " available", 1)
2993
+ e("span", ml, n(d.value.length) + " available", 1)
2939
2994
  ])
2940
2995
  ]),
2941
- e("div", pl, [
2996
+ e("div", yl, [
2942
2997
  e("button", {
2943
2998
  class: N(["artifactuse-panel__action", { "artifactuse-panel__action--loading": ee.value }]),
2944
2999
  disabled: ee.value,
2945
3000
  title: "Download all as ZIP",
2946
- onClick: Ct
3001
+ onClick: Mt
2947
3002
  }, [
2948
- ee.value ? (a(), s("svg", ml, [...t[20] || (t[20] = [
3003
+ ee.value ? (a(), s("svg", wl, [...t[20] || (t[20] = [
2949
3004
  e("circle", {
2950
3005
  cx: "12",
2951
3006
  cy: "12",
@@ -2953,7 +3008,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2953
3008
  "stroke-dasharray": "32",
2954
3009
  "stroke-dashoffset": "32"
2955
3010
  }, null, -1)
2956
- ])])) : (a(), s("svg", _l, [...t[19] || (t[19] = [
3011
+ ])])) : (a(), s("svg", kl, [...t[19] || (t[19] = [
2957
3012
  e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }, null, -1),
2958
3013
  e("polyline", { points: "7 10 12 15 17 10" }, null, -1),
2959
3014
  e("line", {
@@ -2963,11 +3018,11 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2963
3018
  y2: "3"
2964
3019
  }, null, -1)
2965
3020
  ])]))
2966
- ], 10, hl),
3021
+ ], 10, gl),
2967
3022
  e("button", {
2968
3023
  class: "artifactuse-panel__action artifactuse-panel__action--close",
2969
3024
  title: "Close panel",
2970
- onClick: t[1] || (t[1] = (...y) => g(h) && g(h)(...y))
3025
+ onClick: t[1] || (t[1] = (...f) => g(y) && g(y)(...f))
2971
3026
  }, [...t[21] || (t[21] = [
2972
3027
  e("svg", {
2973
3028
  viewBox: "0 0 24 24",
@@ -2991,23 +3046,23 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
2991
3046
  ])])
2992
3047
  ])
2993
3048
  ]),
2994
- e("div", yl, [
2995
- e("div", gl, [
2996
- (a(!0), s(R, null, ve(u.value, (y, U) => (a(), s("button", {
2997
- key: y.id,
3049
+ e("div", bl, [
3050
+ e("div", Cl, [
3051
+ (a(!0), s(R, null, ve(d.value, (f, V) => (a(), s("button", {
3052
+ key: f.id,
2998
3053
  class: "artifactuse-panel__list-item",
2999
- onClick: (Z) => Ke(y)
3054
+ onClick: (J) => Qe(f)
3000
3055
  }, [
3001
3056
  e("span", {
3002
3057
  class: "artifactuse-panel__list-item-icon",
3003
- innerHTML: je(y.language)
3004
- }, null, 8, wl),
3005
- e("div", Cl, [
3006
- e("span", bl, l(y.title || "Untitled"), 1),
3007
- e("span", xl, [
3008
- K(l(g(Se)(y.language)) + " ", 1),
3009
- y.lineCount ? (a(), s(R, { key: 0 }, [
3010
- K(" • " + l(y.lineCount) + " lines ", 1)
3058
+ innerHTML: Ie(f.language)
3059
+ }, null, 8, $l),
3060
+ e("div", Ml, [
3061
+ e("span", Tl, n(f.title || "Untitled"), 1),
3062
+ e("span", Ll, [
3063
+ K(n(g(Ee)(f.language)) + " ", 1),
3064
+ f.lineCount ? (a(), s(R, { key: 0 }, [
3065
+ K(" • " + n(f.lineCount) + " lines ", 1)
3011
3066
  ], 64)) : v("", !0)
3012
3067
  ])
3013
3068
  ]),
@@ -3021,11 +3076,11 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
3021
3076
  e("polyline", { points: "9 18 15 12 9 6" })
3022
3077
  ])
3023
3078
  ], -1))
3024
- ], 8, kl))), 128))
3079
+ ], 8, xl))), 128))
3025
3080
  ])
3026
3081
  ]),
3027
- e("footer", $l, [
3028
- G.value ? (a(), s("a", Ml, [...t[23] || (t[23] = [
3082
+ e("footer", Al, [
3083
+ G.value ? (a(), s("a", Pl, [...t[23] || (t[23] = [
3029
3084
  e("svg", {
3030
3085
  width: "16",
3031
3086
  height: "16",
@@ -3046,7 +3101,7 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
3046
3101
  ])])) : v("", !0)
3047
3102
  ])
3048
3103
  ], 64)) : (a(), s(R, { key: 1 }, [
3049
- e("header", nl, [
3104
+ e("header", ul, [
3050
3105
  t[14] || (t[14] = e("div", { class: "artifactuse-panel__title" }, [
3051
3106
  e("span", { class: "artifactuse-panel__icon" }, [
3052
3107
  e("svg", {
@@ -3063,11 +3118,11 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
3063
3118
  e("span", { class: "artifactuse-panel__name" }, "Artifacts")
3064
3119
  ])
3065
3120
  ], -1)),
3066
- e("div", ol, [
3121
+ e("div", dl, [
3067
3122
  e("button", {
3068
3123
  class: "artifactuse-panel__action artifactuse-panel__action--close",
3069
3124
  title: "Close panel",
3070
- onClick: t[0] || (t[0] = (...y) => g(h) && g(h)(...y))
3125
+ onClick: t[0] || (t[0] = (...f) => g(y) && g(y)(...f))
3071
3126
  }, [...t[13] || (t[13] = [
3072
3127
  e("svg", {
3073
3128
  viewBox: "0 0 24 24",
@@ -3106,8 +3161,8 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
3106
3161
  e("h3", { class: "artifactuse-panel__empty-title" }, "No artifacts yet"),
3107
3162
  e("p", { class: "artifactuse-panel__empty-text" }, " Code blocks, forms, and other interactive content will appear here as the AI generates them. ")
3108
3163
  ], -1)),
3109
- e("footer", rl, [
3110
- G.value ? (a(), s("a", cl, [...t[15] || (t[15] = [
3164
+ e("footer", vl, [
3165
+ G.value ? (a(), s("a", fl, [...t[15] || (t[15] = [
3111
3166
  e("svg", {
3112
3167
  width: "16",
3113
3168
  height: "16",
@@ -3133,22 +3188,22 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
3133
3188
  _: 1
3134
3189
  }));
3135
3190
  }
3136
- }, In = ["title"], Fn = {
3191
+ }, Jn = ["title"], Xn = {
3137
3192
  key: 0,
3138
3193
  class: "artifactuse-panel-toggle-badge"
3139
- }, jn = {
3194
+ }, to = {
3140
3195
  __name: "ArtifactusePanelToggle",
3141
3196
  setup(H) {
3142
- const { state: d, artifactCount: _, hasArtifacts: L, togglePanel: m } = Ee();
3143
- return (r, V) => (a(), s("button", {
3197
+ const { state: c, artifactCount: h, hasArtifacts: T, togglePanel: m } = ze();
3198
+ return (o, q) => (a(), s("button", {
3144
3199
  class: N(["artifactuse-panel-toggle", {
3145
- "artifactuse-panel-toggle--active": g(d).isPanelOpen,
3146
- "artifactuse-panel-toggle--has-artifacts": g(L)
3200
+ "artifactuse-panel-toggle--active": g(c).isPanelOpen,
3201
+ "artifactuse-panel-toggle--has-artifacts": g(T)
3147
3202
  }]),
3148
- onClick: V[0] || (V[0] = (...S) => g(m) && g(m)(...S)),
3149
- title: g(d).isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
3203
+ onClick: q[0] || (q[0] = (...B) => g(m) && g(m)(...B)),
3204
+ title: g(c).isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
3150
3205
  }, [
3151
- V[1] || (V[1] = e("svg", {
3206
+ q[1] || (q[1] = e("svg", {
3152
3207
  viewBox: "0 0 24 24",
3153
3208
  fill: "none",
3154
3209
  stroke: "currentColor",
@@ -3159,148 +3214,160 @@ const Jt = { class: "artifactuse-card__icon" }, Xt = ["innerHTML"], Zt = { class
3159
3214
  e("polyline", { points: "16 18 22 12 16 6" }),
3160
3215
  e("polyline", { points: "8 6 2 12 8 18" })
3161
3216
  ], -1)),
3162
- g(_) > 0 ? (a(), s("span", Fn, l(g(_) > 99 ? "99+" : g(_)), 1)) : v("", !0)
3163
- ], 10, In));
3217
+ g(h) > 0 ? (a(), s("span", Xn, n(g(h) > 99 ? "99+" : g(h)), 1)) : v("", !0)
3218
+ ], 10, Jn));
3164
3219
  }
3165
- }, rt = Symbol("artifactuse");
3166
- function ct(H = {}) {
3167
- var n;
3168
- const d = ot(H), _ = lt({
3220
+ }, ut = Symbol("artifactuse");
3221
+ function dt(H = {}) {
3222
+ var l;
3223
+ const c = ct(H), h = ot({
3169
3224
  artifacts: [],
3170
3225
  activeArtifactId: null,
3171
3226
  isPanelOpen: !1,
3172
3227
  viewMode: "preview",
3173
- isFullscreen: !1
3228
+ isFullscreen: !1,
3229
+ openTabs: [],
3230
+ tabViewModes: {}
3174
3231
  });
3175
- d.state.subscribe((p) => {
3176
- _.artifacts = p.artifacts, _.activeArtifactId = p.activeArtifactId, _.isPanelOpen = p.isPanelOpen, _.viewMode = p.viewMode, _.isFullscreen = p.isFullscreen;
3232
+ c.state.subscribe((_) => {
3233
+ h.artifacts = _.artifacts, h.activeArtifactId = _.activeArtifactId, h.isPanelOpen = _.isPanelOpen, h.viewMode = _.viewMode, h.isFullscreen = _.isFullscreen, h.openTabs = _.openTabs, h.tabViewModes = _.tabViewModes;
3177
3234
  });
3178
- const L = b(() => _.activeArtifactId && _.artifacts.find((p) => p.id === _.activeArtifactId) || null), m = b(() => _.artifacts.filter((p) => !p.isInline).length), r = b(() => _.artifacts.some((p) => !p.isInline)), V = b(() => d.getPanelTypes()), S = b(() => L.value ? d.getPanelUrl(L.value) : null);
3179
- if (d.applyTheme(), H.theme === "auto" || !H.theme) {
3180
- const p = ((n = d.bridge) == null ? void 0 : n.theme) || d.theme;
3181
- p != null && p.watchSystemTheme && p.watchSystemTheme(() => {
3182
- d.applyTheme();
3235
+ const T = C(() => h.activeArtifactId && h.artifacts.find((_) => _.id === h.activeArtifactId) || null), m = C(() => h.artifacts.filter((_) => !_.isInline).length), o = C(() => h.artifacts.some((_) => !_.isInline)), q = C(() => c.getPanelTypes()), B = C(() => T.value ? c.getPanelUrl(T.value) : null);
3236
+ if (c.applyTheme(), H.theme === "auto" || !H.theme) {
3237
+ const _ = ((l = c.bridge) == null ? void 0 : l.theme) || c.theme;
3238
+ _ != null && _.watchSystemTheme && _.watchSystemTheme(() => {
3239
+ c.applyTheme();
3183
3240
  });
3184
3241
  }
3185
- const h = {
3186
- instance: d,
3187
- state: _,
3188
- activeArtifact: L,
3242
+ const y = {
3243
+ instance: c,
3244
+ state: h,
3245
+ activeArtifact: T,
3189
3246
  artifactCount: m,
3190
- hasArtifacts: r,
3247
+ hasArtifacts: o,
3191
3248
  // Panel computed
3192
- panelTypes: V,
3193
- activePanelUrl: S,
3249
+ panelTypes: q,
3250
+ activePanelUrl: B,
3194
3251
  // Methods
3195
- processMessage: d.processMessage,
3196
- initializeContent: d.initializeContent,
3197
- openArtifact: d.openArtifact,
3198
- openFile: d.openFile,
3199
- openCode: d.openCode,
3200
- updateFile: d.updateFile,
3201
- closePanel: d.closePanel,
3202
- togglePanel: d.togglePanel,
3203
- toggleFullscreen: d.toggleFullscreen,
3204
- setViewMode: d.setViewMode,
3205
- getPanelUrl: d.getPanelUrl,
3206
- sendToPanel: d.sendToPanel,
3252
+ processMessage: c.processMessage,
3253
+ initializeContent: c.initializeContent,
3254
+ openArtifact: c.openArtifact,
3255
+ openFile: c.openFile,
3256
+ openCode: c.openCode,
3257
+ updateFile: c.updateFile,
3258
+ closePanel: c.closePanel,
3259
+ togglePanel: c.togglePanel,
3260
+ toggleFullscreen: c.toggleFullscreen,
3261
+ setViewMode: c.setViewMode,
3262
+ getPanelUrl: c.getPanelUrl,
3263
+ sendToPanel: c.sendToPanel,
3207
3264
  // Panel management
3208
- hasPanel: d.hasPanel,
3209
- registerPanel: d.registerPanel,
3210
- unregisterPanel: d.unregisterPanel,
3211
- getPanelTypes: d.getPanelTypes,
3265
+ hasPanel: c.hasPanel,
3266
+ registerPanel: c.registerPanel,
3267
+ unregisterPanel: c.unregisterPanel,
3268
+ getPanelTypes: c.getPanelTypes,
3269
+ // Multi-tab
3270
+ closeTab: c.closeTab,
3271
+ closeOtherTabs: c.closeOtherTabs,
3272
+ closeAllTabs: c.closeAllTabs,
3212
3273
  // Events
3213
- on: d.on,
3214
- off: d.off,
3274
+ on: c.on,
3275
+ off: c.off,
3215
3276
  // State management
3216
- clearArtifacts: () => d.state.clear(),
3277
+ clearArtifacts: () => c.state.clear(),
3217
3278
  // Theme - wrap setTheme to also apply
3218
- applyTheme: d.applyTheme,
3219
- setTheme: (p) => {
3220
- d.setTheme(p), d.applyTheme();
3279
+ applyTheme: c.applyTheme,
3280
+ setTheme: (_) => {
3281
+ c.setTheme(_), c.applyTheme();
3221
3282
  },
3222
- getTheme: d.getTheme
3283
+ getTheme: c.getTheme
3223
3284
  };
3224
- return Ot(rt, h), h;
3285
+ return Nt(ut, y), y;
3225
3286
  }
3226
- function Ee() {
3227
- const H = Ut(rt);
3228
- return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), ct());
3287
+ function ze() {
3288
+ const H = Wt(ut);
3289
+ return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), dt());
3229
3290
  }
3230
- function Vn(H = {}) {
3231
- const d = ot(H), _ = lt({
3291
+ function Zn(H = {}) {
3292
+ const c = ct(H), h = ot({
3232
3293
  artifacts: [],
3233
3294
  activeArtifactId: null,
3234
3295
  isPanelOpen: !1,
3235
3296
  viewMode: "preview",
3236
- isFullscreen: !1
3297
+ isFullscreen: !1,
3298
+ openTabs: [],
3299
+ tabViewModes: {}
3237
3300
  });
3238
- let L;
3301
+ let T;
3239
3302
  $e(() => {
3240
- L = d.state.subscribe((n) => {
3241
- _.artifacts = n.artifacts, _.activeArtifactId = n.activeArtifactId, _.isPanelOpen = n.isPanelOpen, _.viewMode = n.viewMode, _.isFullscreen = n.isFullscreen;
3242
- }), d.applyTheme();
3243
- }), De(() => {
3244
- L && L(), d.destroy();
3303
+ T = c.state.subscribe((l) => {
3304
+ h.artifacts = l.artifacts, h.activeArtifactId = l.activeArtifactId, h.isPanelOpen = l.isPanelOpen, h.viewMode = l.viewMode, h.isFullscreen = l.isFullscreen, h.openTabs = l.openTabs, h.tabViewModes = l.tabViewModes;
3305
+ }), c.applyTheme();
3306
+ }), Ne(() => {
3307
+ T && T(), c.destroy();
3245
3308
  });
3246
- const m = b(() => _.activeArtifactId && _.artifacts.find((n) => n.id === _.activeArtifactId) || null), r = b(() => _.artifacts.filter((n) => !n.isInline).length), V = b(() => _.artifacts.some((n) => !n.isInline)), S = b(() => d.getPanelTypes()), h = b(() => m.value ? d.getPanelUrl(m.value) : null);
3309
+ const m = C(() => h.activeArtifactId && h.artifacts.find((l) => l.id === h.activeArtifactId) || null), o = C(() => h.artifacts.filter((l) => !l.isInline).length), q = C(() => h.artifacts.some((l) => !l.isInline)), B = C(() => c.getPanelTypes()), y = C(() => m.value ? c.getPanelUrl(m.value) : null);
3247
3310
  return {
3248
- instance: d,
3249
- state: _,
3311
+ instance: c,
3312
+ state: h,
3250
3313
  activeArtifact: m,
3251
- artifactCount: r,
3252
- hasArtifacts: V,
3314
+ artifactCount: o,
3315
+ hasArtifacts: q,
3253
3316
  // Panel computed
3254
- panelTypes: S,
3255
- activePanelUrl: h,
3317
+ panelTypes: B,
3318
+ activePanelUrl: y,
3256
3319
  // Methods
3257
- processMessage: d.processMessage,
3258
- initializeContent: d.initializeContent,
3259
- openArtifact: d.openArtifact,
3260
- openFile: d.openFile,
3261
- openCode: d.openCode,
3262
- updateFile: d.updateFile,
3263
- closePanel: d.closePanel,
3264
- togglePanel: d.togglePanel,
3265
- toggleFullscreen: d.toggleFullscreen,
3266
- setViewMode: d.setViewMode,
3267
- getPanelUrl: d.getPanelUrl,
3268
- sendToPanel: d.sendToPanel,
3320
+ processMessage: c.processMessage,
3321
+ initializeContent: c.initializeContent,
3322
+ openArtifact: c.openArtifact,
3323
+ openFile: c.openFile,
3324
+ openCode: c.openCode,
3325
+ updateFile: c.updateFile,
3326
+ closePanel: c.closePanel,
3327
+ togglePanel: c.togglePanel,
3328
+ toggleFullscreen: c.toggleFullscreen,
3329
+ setViewMode: c.setViewMode,
3330
+ getPanelUrl: c.getPanelUrl,
3331
+ sendToPanel: c.sendToPanel,
3269
3332
  // Panel management
3270
- hasPanel: d.hasPanel,
3271
- registerPanel: d.registerPanel,
3272
- unregisterPanel: d.unregisterPanel,
3273
- getPanelTypes: d.getPanelTypes,
3333
+ hasPanel: c.hasPanel,
3334
+ registerPanel: c.registerPanel,
3335
+ unregisterPanel: c.unregisterPanel,
3336
+ getPanelTypes: c.getPanelTypes,
3337
+ // Multi-tab
3338
+ closeTab: c.closeTab,
3339
+ closeOtherTabs: c.closeOtherTabs,
3340
+ closeAllTabs: c.closeAllTabs,
3274
3341
  // Events
3275
- on: d.on,
3276
- off: d.off,
3342
+ on: c.on,
3343
+ off: c.off,
3277
3344
  // State management
3278
- clearArtifacts: () => d.state.clear(),
3345
+ clearArtifacts: () => c.state.clear(),
3279
3346
  // Theme - wrap setTheme to also apply
3280
- applyTheme: d.applyTheme,
3281
- setTheme: (n) => {
3282
- d.setTheme(n), d.applyTheme();
3347
+ applyTheme: c.applyTheme,
3348
+ setTheme: (l) => {
3349
+ c.setTheme(l), c.applyTheme();
3283
3350
  },
3284
- getTheme: d.getTheme
3351
+ getTheme: c.getTheme
3285
3352
  };
3286
3353
  }
3287
- const Nn = {
3288
- provideArtifactuse: ct,
3289
- useArtifactuse: Ee,
3290
- createArtifactuseComposable: Vn,
3291
- DEFAULT_PANELS: Nt
3354
+ const ao = {
3355
+ provideArtifactuse: dt,
3356
+ useArtifactuse: ze,
3357
+ createArtifactuseComposable: Zn,
3358
+ DEFAULT_PANELS: Zt
3292
3359
  };
3293
3360
  export {
3294
- Un as ArtifactuseAgentMessage,
3295
- ia as ArtifactuseCard,
3296
- Ja as ArtifactuseInlineForm,
3297
- Dn as ArtifactusePanel,
3298
- jn as ArtifactusePanelToggle,
3299
- Ki as ArtifactuseSocialPreview,
3300
- il as ArtifactuseViewer,
3301
- Nt as DEFAULT_PANELS,
3302
- Vn as createArtifactuseComposable,
3303
- Nn as default,
3304
- ct as provideArtifactuse,
3305
- Ee as useArtifactuse
3361
+ Gn as ArtifactuseAgentMessage,
3362
+ ra as ArtifactuseCard,
3363
+ Ya as ArtifactuseInlineForm,
3364
+ eo as ArtifactusePanel,
3365
+ to as ArtifactusePanelToggle,
3366
+ el as ArtifactuseSocialPreview,
3367
+ rl as ArtifactuseViewer,
3368
+ Zt as DEFAULT_PANELS,
3369
+ Zn as createArtifactuseComposable,
3370
+ ao as default,
3371
+ dt as provideArtifactuse,
3372
+ ze as useArtifactuse
3306
3373
  };