artifactuse 0.2.6 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue/index.js CHANGED
@@ -1,19 +1,19 @@
1
- import { ref as T, computed as C, createElementBlock as s, openBlock as a, normalizeClass as N, createElementVNode as e, toDisplayString as l, 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 He, createStaticVNode as Ut, createBlock as xe, resolveDynamicComponent as Dt, nextTick as Ce, onUnmounted as We, Teleport as jt, createVNode as ze, Transition as Ee, withCtx as Be, withKeys as Nt, onBeforeUnmount as Wt, unref as y, withDirectives as ot, vShow as rt, reactive as ut, provide as Jt, inject as Xt } from "vue";
2
- import { g as Se, f as dt, a as je, b as Ne, n as Zt, i as ct, c as Kt, D as Yt, d as vt } from "../index-W575iBkm.js";
3
- import { J as Qt } from "../jszip.min-CdmYyw5L.js";
4
- const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class: "artifactuse-card__content" }, aa = { class: "artifactuse-card__title" }, sa = { class: "artifactuse-card__meta" }, ia = { class: "artifactuse-card__type" }, la = { class: "artifactuse-card__size" }, na = { class: "artifactuse-card__actions" }, oa = ["title"], ra = {
1
+ import { ref as M, computed as b, createElementBlock as s, openBlock as a, normalizeClass as I, createElementVNode as e, toDisplayString as n, withModifiers as _e, onMounted as Te, watch as oe, Fragment as F, createCommentVNode as v, renderList as de, createTextVNode as Y, h as ne, normalizeStyle as Se, createStaticVNode as ea, createBlock as Me, resolveDynamicComponent as ta, nextTick as ke, onUnmounted as Ye, Teleport as aa, createVNode as Fe, Transition as ze, withCtx as Ve, withKeys as sa, onBeforeUnmount as la, unref as y, withDirectives as _t, vShow as ht, reactive as yt, provide as ia, inject as na } from "vue";
2
+ import { g as Ie, f as gt, a as Ze, b as Ke, n as oa, i as mt, c as ra, D as ca, d as kt } from "../index-vmcpJRYe.js";
3
+ import { J as ua } from "../jszip.min-CdmYyw5L.js";
4
+ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class: "artifactuse-card__content" }, pa = { class: "artifactuse-card__title" }, _a = { class: "artifactuse-card__meta" }, ha = { class: "artifactuse-card__type" }, ma = { class: "artifactuse-card__size" }, ya = { class: "artifactuse-card__actions" }, ga = ["title"], ka = {
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
- }, ca = {
10
+ }, wa = {
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
- }, ua = {
16
+ }, ba = {
17
17
  __name: "ArtifactuseCard",
18
18
  props: {
19
19
  artifact: {
@@ -26,58 +26,58 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
26
26
  }
27
27
  },
28
28
  emits: ["open", "copy", "download"],
29
- setup(H, { emit: c }) {
30
- const _ = H, M = c, f = T(!1), o = C(() => Se(_.artifact.language)), q = C(() => {
29
+ setup(P, { emit: c }) {
30
+ const _ = P, T = c, p = M(!1), r = b(() => Ie(_.artifact.language)), q = b(() => {
31
31
  var $;
32
- return dt(_.artifact.size || (($ = _.artifact.code) == null ? void 0 : $.length) || 0);
33
- }), E = C(() => je(_.artifact.language));
32
+ return gt(_.artifact.size || (($ = _.artifact.code) == null ? void 0 : $.length) || 0);
33
+ }), A = b(() => Ze(_.artifact.language));
34
34
  function g($) {
35
- $.stopPropagation(), M("open", _.artifact);
35
+ $.stopPropagation(), T("open", _.artifact);
36
36
  }
37
- async function n() {
37
+ async function o() {
38
38
  try {
39
- await navigator.clipboard.writeText(_.artifact.code), f.value = !0, setTimeout(() => {
40
- f.value = !1;
41
- }, 2e3), M("copy", _.artifact);
39
+ await navigator.clipboard.writeText(_.artifact.code), p.value = !0, setTimeout(() => {
40
+ p.value = !1;
41
+ }, 2e3), T("copy", _.artifact);
42
42
  } catch ($) {
43
43
  console.error("Failed to copy:", $);
44
44
  }
45
45
  }
46
46
  function h() {
47
- var W;
48
- const $ = new Blob([_.artifact.code], { type: "text/plain" }), I = URL.createObjectURL($), x = document.createElement("a"), j = Ne(_.artifact.language), O = ((W = _.artifact.title) == null ? void 0 : W.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
49
- x.href = I, x.download = `${O}.${j}`, document.body.appendChild(x), x.click(), document.body.removeChild(x), URL.revokeObjectURL(I), M("download", _.artifact);
47
+ var N;
48
+ const $ = new Blob([_.artifact.code], { type: "text/plain" }), V = URL.createObjectURL($), x = document.createElement("a"), D = Ke(_.artifact.language), U = ((N = _.artifact.title) == null ? void 0 : N.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
49
+ x.href = V, x.download = `${U}.${D}`, document.body.appendChild(x), x.click(), document.body.removeChild(x), URL.revokeObjectURL(V), T("download", _.artifact);
50
50
  }
51
- return ($, I) => (a(), s("div", {
52
- class: N(["artifactuse-card", { "artifactuse-card--active": H.isActive }]),
51
+ return ($, V) => (a(), s("div", {
52
+ class: I(["artifactuse-card", { "artifactuse-card--active": P.isActive }]),
53
53
  onClick: g
54
54
  }, [
55
- e("div", Gt, [
55
+ e("div", da, [
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: E.value
62
- }, null, 8, ea))
61
+ innerHTML: A.value
62
+ }, null, 8, va))
63
63
  ]),
64
- e("div", ta, [
65
- e("div", aa, l(H.artifact.title), 1),
66
- e("div", sa, [
67
- e("span", ia, l(o.value), 1),
68
- I[0] || (I[0] = e("span", { class: "artifactuse-card__separator" }, "•", -1)),
69
- e("span", la, l(q.value), 1)
64
+ e("div", fa, [
65
+ e("div", pa, n(P.artifact.title), 1),
66
+ e("div", _a, [
67
+ e("span", ha, n(r.value), 1),
68
+ V[0] || (V[0] = e("span", { class: "artifactuse-card__separator" }, "•", -1)),
69
+ e("span", ma, n(q.value), 1)
70
70
  ])
71
71
  ]),
72
- e("div", na, [
72
+ e("div", ya, [
73
73
  e("button", {
74
74
  class: "artifactuse-card__action",
75
- onClick: he(n, ["stop"]),
76
- title: f.value ? "Copied!" : "Copy code"
75
+ onClick: _e(o, ["stop"]),
76
+ title: p.value ? "Copied!" : "Copy code"
77
77
  }, [
78
- f.value ? (a(), s("svg", ca, [...I[2] || (I[2] = [
78
+ p.value ? (a(), s("svg", wa, [...V[2] || (V[2] = [
79
79
  e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
80
- ])])) : (a(), s("svg", ra, [...I[1] || (I[1] = [
80
+ ])])) : (a(), s("svg", ka, [...V[1] || (V[1] = [
81
81
  e("rect", {
82
82
  x: "9",
83
83
  y: "9",
@@ -88,12 +88,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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, oa),
91
+ ], 8, ga),
92
92
  e("button", {
93
93
  class: "artifactuse-card__action",
94
- onClick: he(h, ["stop"]),
94
+ onClick: _e(h, ["stop"]),
95
95
  title: "Download file"
96
- }, [...I[3] || (I[3] = [
96
+ }, [...V[3] || (V[3] = [
97
97
  e("svg", {
98
98
  viewBox: "0 0 24 24",
99
99
  fill: "none",
@@ -111,7 +111,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
111
111
  ], -1)
112
112
  ])])
113
113
  ]),
114
- I[4] || (I[4] = e("div", { class: "artifactuse-card__arrow" }, [
114
+ V[4] || (V[4] = e("div", { class: "artifactuse-card__arrow" }, [
115
115
  e("svg", {
116
116
  viewBox: "0 0 24 24",
117
117
  fill: "none",
@@ -123,10 +123,10 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
123
123
  ], -1))
124
124
  ], 2));
125
125
  }
126
- }, da = ["data-artifactuse-theme"], va = {
126
+ }, Ca = ["data-artifactuse-theme"], xa = {
127
127
  key: 0,
128
128
  class: "artifactuse-form-collapsed"
129
- }, fa = { class: "artifactuse-form-collapsed-icon" }, pa = {
129
+ }, $a = { class: "artifactuse-form-collapsed-icon" }, Ma = {
130
130
  key: 0,
131
131
  viewBox: "0 0 24 24",
132
132
  fill: "none",
@@ -134,7 +134,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
134
134
  "stroke-width": "2.5",
135
135
  "stroke-linecap": "round",
136
136
  "stroke-linejoin": "round"
137
- }, _a = {
137
+ }, Ta = {
138
138
  key: 1,
139
139
  viewBox: "0 0 24 24",
140
140
  fill: "none",
@@ -142,7 +142,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
142
142
  "stroke-width": "2.5",
143
143
  "stroke-linecap": "round",
144
144
  "stroke-linejoin": "round"
145
- }, ha = {
145
+ }, La = {
146
146
  key: 2,
147
147
  viewBox: "0 0 24 24",
148
148
  fill: "none",
@@ -150,64 +150,64 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
150
150
  "stroke-width": "2.5",
151
151
  "stroke-linecap": "round",
152
152
  "stroke-linejoin": "round"
153
- }, ma = { class: "artifactuse-form-collapsed-title" }, ya = {
153
+ }, Pa = { class: "artifactuse-form-collapsed-title" }, Ea = {
154
154
  key: 0,
155
155
  class: "artifactuse-form-header"
156
- }, ga = {
156
+ }, Aa = {
157
157
  key: 0,
158
158
  class: "artifactuse-form-title"
159
- }, ka = {
159
+ }, Ha = {
160
160
  key: 1,
161
161
  class: "artifactuse-form-description"
162
- }, wa = {
162
+ }, Ba = {
163
163
  key: 1,
164
164
  class: "artifactuse-form-buttons"
165
- }, ba = ["disabled", "onClick"], Ca = ["innerHTML"], xa = { class: "artifactuse-form-fields" }, $a = {
165
+ }, Sa = ["disabled", "onClick"], za = ["innerHTML"], Va = { class: "artifactuse-form-fields" }, Ia = {
166
166
  key: 0,
167
167
  class: "artifactuse-form-buttons"
168
- }, Ma = ["type", "disabled", "onClick"], Ta = {
168
+ }, Fa = ["type", "disabled", "onClick"], Ra = {
169
169
  key: 0,
170
170
  class: "artifactuse-form-btn-spinner"
171
- }, La = ["innerHTML"], Pa = {
171
+ }, qa = ["innerHTML"], Oa = {
172
172
  key: 1,
173
173
  class: "artifactuse-form-divider"
174
- }, Aa = {
174
+ }, Ua = {
175
175
  key: 2,
176
176
  class: "artifactuse-form-heading"
177
- }, Ha = {
177
+ }, Da = {
178
178
  key: 3,
179
179
  class: "artifactuse-form-field"
180
- }, Ea = { class: "artifactuse-checkbox-label" }, Ba = ["checked", "disabled", "onChange"], Sa = { class: "artifactuse-checkbox-text" }, za = {
180
+ }, ja = { class: "artifactuse-checkbox-label" }, Na = ["checked", "disabled", "onChange"], Wa = { class: "artifactuse-checkbox-text" }, Ja = {
181
181
  key: 0,
182
182
  class: "artifactuse-required"
183
- }, Va = {
183
+ }, Xa = {
184
184
  key: 0,
185
185
  class: "artifactuse-help-text"
186
- }, Ia = {
186
+ }, Za = {
187
187
  key: 1,
188
188
  class: "artifactuse-error-text"
189
- }, Fa = {
189
+ }, Ka = {
190
190
  key: 4,
191
191
  class: "artifactuse-form-field"
192
- }, Ra = ["for"], qa = {
192
+ }, Ya = ["for"], Qa = {
193
193
  key: 0,
194
194
  class: "artifactuse-required"
195
- }, Oa = ["id", "type", "value", "placeholder", "disabled", "required", "onInput"], Ua = ["id", "value", "placeholder", "disabled", "required", "rows", "onInput"], Da = ["id", "value", "disabled", "required", "onChange"], ja = { value: "" }, Na = ["value", "disabled"], Wa = {
195
+ }, Ga = ["id", "type", "value", "placeholder", "disabled", "required", "onInput"], es = ["id", "value", "placeholder", "disabled", "required", "rows", "onInput"], ts = ["id", "value", "disabled", "required", "onChange"], as = { value: "" }, ss = ["value", "disabled"], ls = {
196
196
  key: 3,
197
197
  class: "artifactuse-radio-group"
198
- }, Ja = ["name", "value", "checked", "disabled", "onChange"], Xa = {
198
+ }, is = ["name", "value", "checked", "disabled", "onChange"], ns = {
199
199
  key: 4,
200
200
  class: "artifactuse-help-text"
201
- }, Za = {
201
+ }, os = {
202
202
  key: 5,
203
203
  class: "artifactuse-error-text"
204
- }, Ka = {
204
+ }, rs = {
205
205
  key: 0,
206
206
  class: "artifactuse-form-buttons artifactuse-form-buttons-default"
207
- }, Ya = ["disabled"], Qa = {
207
+ }, cs = ["disabled"], us = {
208
208
  key: 0,
209
209
  class: "artifactuse-form-btn-spinner"
210
- }, Ga = {
210
+ }, ds = {
211
211
  __name: "ArtifactuseInlineForm",
212
212
  props: {
213
213
  artifact: { type: Object, required: !0 },
@@ -216,136 +216,136 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
216
216
  initialState: {
217
217
  type: String,
218
218
  default: "active",
219
- validator: (H) => ["active", "submitted", "cancelled", "inactive"].includes(H)
219
+ validator: (P) => ["active", "submitted", "cancelled", "inactive"].includes(P)
220
220
  }
221
221
  },
222
222
  emits: ["submit", "cancel", "reset", "button-click"],
223
- setup(H, { emit: c }) {
224
- const _ = H, M = c, f = T(_.initialState), o = C(() => f.value !== "active"), q = C(() => f.value === "active" ? "" : `artifactuse-form--${f.value}`);
225
- function E(w) {
226
- f.value = w;
223
+ setup(P, { emit: c }) {
224
+ const _ = P, T = c, p = M(_.initialState), r = b(() => p.value !== "active"), q = b(() => p.value === "active" ? "" : `artifactuse-form--${p.value}`);
225
+ function A(w) {
226
+ p.value = w;
227
227
  }
228
- const g = C(() => {
228
+ const g = b(() => {
229
229
  try {
230
230
  return JSON.parse(_.artifact.code);
231
231
  } catch {
232
232
  return { title: "Invalid Form", variant: "fields", data: { fields: [] } };
233
233
  }
234
- }), n = T(null), h = C(() => _.artifact.id || g.value.id || `form-${Date.now()}`), $ = C(() => `artifactuse-form-${g.value.variant || "fields"}`), I = C(() => g.value.title || "Form"), x = T({}), j = T({}), O = T(!1), W = C(() => {
234
+ }), o = M(null), h = b(() => _.artifact.id || g.value.id || `form-${Date.now()}`), $ = b(() => `artifactuse-form-${g.value.variant || "fields"}`), V = b(() => g.value.title || "Form"), x = M({}), D = M({}), U = M(!1), N = b(() => {
235
235
  var w;
236
236
  return ((w = g.value.data) == null ? void 0 : w.fields) || [];
237
- }), Y = C(() => {
237
+ }), ee = b(() => {
238
238
  var w;
239
239
  return g.value.variant === "buttons" ? ((w = g.value.data) == null ? void 0 : w.fields) || [] : [];
240
- }), S = C(() => W.value.some((w) => w.type === "buttons"));
241
- function ie(w) {
240
+ }), B = b(() => N.value.some((w) => w.type === "buttons"));
241
+ function re(w) {
242
242
  if (!w) return null;
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
- if (!isNaN(z) && !isNaN(le) && !isNaN(pe)) return `${z}, ${le}, ${pe}`;
243
+ const E = w.trim();
244
+ if (E.startsWith("#")) {
245
+ let d = E.slice(1);
246
+ if (d.length === 3 && (d = d.split("").map((L) => L + L).join("")), d.length === 6) {
247
+ const L = parseInt(d.slice(0, 2), 16), se = parseInt(d.slice(2, 4), 16), ce = parseInt(d.slice(4, 6), 16);
248
+ if (!isNaN(L) && !isNaN(se) && !isNaN(ce)) return `${L}, ${se}, ${ce}`;
249
249
  }
250
250
  }
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 B = L.split(/[\s,]+/).map(Number).filter((u) => !isNaN(u));
254
- return B.length >= 3 ? `${B[0]}, ${B[1]}, ${B[2]}` : null;
255
- }
256
- function Z() {
257
- if (n.value && _.accent) {
258
- const w = ie(_.accent);
259
- w && n.value.style.setProperty("--artifactuse-primary", w);
251
+ const i = E.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
252
+ if (i) return `${i[1]}, ${i[2]}, ${i[3]}`;
253
+ const H = E.split(/[\s,]+/).map(Number).filter((d) => !isNaN(d));
254
+ return H.length >= 3 ? `${H[0]}, ${H[1]}, ${H[2]}` : null;
255
+ }
256
+ function K() {
257
+ if (o.value && _.accent) {
258
+ const w = re(_.accent);
259
+ w && o.value.style.setProperty("--artifactuse-primary", w);
260
260
  }
261
261
  }
262
- $e(() => {
263
- Z(), f.value = _.initialState;
264
- }), de(() => _.accent, Z), de(() => _.initialState, (w) => {
265
- f.value = w;
262
+ Te(() => {
263
+ K(), p.value = _.initialState;
264
+ }), oe(() => _.accent, K), oe(() => _.initialState, (w) => {
265
+ p.value = w;
266
266
  });
267
- function X() {
268
- var r;
267
+ function Z() {
268
+ var i;
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
- }), (r = g.value.data) != null && r.defaults && Object.assign(w, g.value.data.defaults), x.value = w;
270
+ N.value.forEach((H) => {
271
+ ["buttons", "divider", "heading"].includes(H.type) || (H.defaultValue !== void 0 ? w[H.name] = H.defaultValue : H.type === "checkbox" ? w[H.name] = !1 : w[H.name] = "");
272
+ }), (i = g.value.data) != null && i.defaults && Object.assign(w, g.value.data.defaults), x.value = w;
273
273
  }
274
- X(), de(() => _.artifact.code, X);
275
- function oe(w) {
274
+ Z(), oe(() => _.artifact.code, Z);
275
+ function ve(w) {
276
276
  return ["text", "email", "password", "tel", "url", "number", "date", "time", "datetime-local"].includes(w);
277
277
  }
278
278
  function m(w) {
279
- return w ? w.map((L) => typeof L == "string" ? { label: L, value: L } : L) : [];
279
+ return w ? w.map((E) => typeof E == "string" ? { label: E, value: E } : E) : [];
280
280
  }
281
- function k(w, L) {
282
- x.value[w] = L, j.value[w] && delete j.value[w];
281
+ function k(w, E) {
282
+ x.value[w] = E, D.value[w] && delete D.value[w];
283
283
  }
284
- function ee() {
285
- var B;
284
+ function ae() {
285
+ var H;
286
286
  const w = {};
287
- W.value.forEach((u) => {
288
- if (["buttons", "divider", "heading"].includes(u.type)) return;
289
- const z = x.value[u.name];
290
- if (u.required && !z && z !== 0 && z !== !1) {
291
- w[u.name] = `${u.label || "This field"} is required`;
287
+ N.value.forEach((d) => {
288
+ if (["buttons", "divider", "heading"].includes(d.type)) return;
289
+ const L = x.value[d.name];
290
+ if (d.required && !L && L !== 0 && L !== !1) {
291
+ w[d.name] = `${d.label || "This field"} is required`;
292
292
  return;
293
293
  }
294
- if (u.pattern && z && !new RegExp(u.pattern).test(z)) {
295
- w[u.name] = u.patternMessage || `${u.label || "This field"} is invalid`;
294
+ if (d.pattern && L && !new RegExp(d.pattern).test(L)) {
295
+ w[d.name] = d.patternMessage || `${d.label || "This field"} is invalid`;
296
296
  return;
297
297
  }
298
- if (u.type === "email" && z && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(z)) {
299
- w[u.name] = "Please enter a valid email address";
298
+ if (d.type === "email" && L && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(L)) {
299
+ w[d.name] = "Please enter a valid email address";
300
300
  return;
301
301
  }
302
- if (u.minLength && z && z.length < u.minLength) {
303
- w[u.name] = `Minimum ${u.minLength} characters required`;
302
+ if (d.minLength && L && L.length < d.minLength) {
303
+ w[d.name] = `Minimum ${d.minLength} characters required`;
304
304
  return;
305
305
  }
306
- if (u.maxLength && z && z.length > u.maxLength) {
307
- w[u.name] = `Maximum ${u.maxLength} characters allowed`;
306
+ if (d.maxLength && L && L.length > d.maxLength) {
307
+ w[d.name] = `Maximum ${d.maxLength} characters allowed`;
308
308
  return;
309
309
  }
310
310
  });
311
- const r = (B = g.value.data) == null ? void 0 : B.validation;
312
- return r && Object.entries(r).forEach(([u, z]) => {
313
- if (w[u]) return;
314
- const le = x.value[u];
315
- z.pattern && le && (new RegExp(z.pattern).test(le) || (w[u] = z.message || `${u} is invalid`));
316
- }), j.value = w, Object.keys(w).length === 0;
317
- }
318
- function re() {
319
- X(), j.value = {};
320
- }
321
- function P() {
322
- ee() && (O.value = !0, M("submit", {
311
+ const i = (H = g.value.data) == null ? void 0 : H.validation;
312
+ return i && Object.entries(i).forEach(([d, L]) => {
313
+ if (w[d]) return;
314
+ const se = x.value[d];
315
+ L.pattern && se && (new RegExp(L.pattern).test(se) || (w[d] = L.message || `${d} is invalid`));
316
+ }), D.value = w, Object.keys(w).length === 0;
317
+ }
318
+ function Q() {
319
+ Z(), D.value = {};
320
+ }
321
+ function W() {
322
+ ae() && (U.value = !0, T("submit", {
323
323
  formId: h.value,
324
324
  action: "submit",
325
325
  values: { ...x.value },
326
326
  timestamp: Date.now()
327
327
  }), setTimeout(() => {
328
- O.value = !1, E("submitted");
328
+ U.value = !1, A("submitted");
329
329
  }, 300));
330
330
  }
331
- function Q(w) {
332
- const L = w.action || "custom";
333
- switch (L) {
331
+ function ie(w) {
332
+ const E = w.action || "custom";
333
+ switch (E) {
334
334
  case "submit":
335
- P();
335
+ W();
336
336
  break;
337
337
  case "cancel":
338
- M("cancel", {
338
+ T("cancel", {
339
339
  formId: h.value,
340
340
  action: "cancel",
341
341
  buttonName: w.name || "cancel",
342
342
  timestamp: Date.now()
343
343
  }), setTimeout(() => {
344
- E("cancelled");
344
+ A("cancelled");
345
345
  }, 150);
346
346
  break;
347
347
  case "reset":
348
- re(), M("reset", {
348
+ Q(), T("reset", {
349
349
  formId: h.value,
350
350
  action: "reset",
351
351
  buttonName: w.name || "reset",
@@ -354,34 +354,34 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
354
354
  break;
355
355
  case "custom":
356
356
  default:
357
- M("button-click", {
357
+ T("button-click", {
358
358
  formId: h.value,
359
- action: L,
359
+ action: E,
360
360
  buttonName: w.name || w.label,
361
361
  buttonLabel: w.label,
362
362
  values: { ...x.value },
363
363
  timestamp: Date.now()
364
364
  }), setTimeout(() => {
365
- E("submitted");
365
+ A("submitted");
366
366
  }, 150);
367
367
  break;
368
368
  }
369
369
  }
370
- return (w, L) => (a(), s("div", {
370
+ return (w, E) => (a(), s("div", {
371
371
  ref_key: "containerRef",
372
- ref: n,
373
- class: N([
372
+ ref: o,
373
+ class: I([
374
374
  "artifactuse-inline-form",
375
375
  $.value,
376
376
  q.value
377
377
  ]),
378
- "data-artifactuse-theme": H.theme
378
+ "data-artifactuse-theme": P.theme
379
379
  }, [
380
- o.value ? (a(), s("div", va, [
381
- e("div", fa, [
382
- f.value === "submitted" ? (a(), s("svg", pa, [...L[1] || (L[1] = [
380
+ r.value ? (a(), s("div", xa, [
381
+ e("div", $a, [
382
+ p.value === "submitted" ? (a(), s("svg", Ma, [...E[1] || (E[1] = [
383
383
  e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
384
- ])])) : f.value === "cancelled" ? (a(), s("svg", _a, [...L[2] || (L[2] = [
384
+ ])])) : p.value === "cancelled" ? (a(), s("svg", Ta, [...E[2] || (E[2] = [
385
385
  e("line", {
386
386
  x1: "18",
387
387
  y1: "6",
@@ -394,7 +394,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
394
394
  x2: "18",
395
395
  y2: "18"
396
396
  }, null, -1)
397
- ])])) : (a(), s("svg", ha, [...L[3] || (L[3] = [
397
+ ])])) : (a(), s("svg", La, [...E[3] || (E[3] = [
398
398
  e("line", {
399
399
  x1: "5",
400
400
  y1: "12",
@@ -403,216 +403,216 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
403
403
  }, null, -1)
404
404
  ])]))
405
405
  ]),
406
- e("span", ma, l(I.value), 1)
407
- ])) : (a(), s(R, { key: 1 }, [
408
- g.value.title || g.value.description ? (a(), s("div", ya, [
409
- g.value.title ? (a(), s("div", ga, l(g.value.title), 1)) : v("", !0),
410
- g.value.description ? (a(), s("p", ka, l(g.value.description), 1)) : v("", !0)
406
+ e("span", Pa, n(V.value), 1)
407
+ ])) : (a(), s(F, { key: 1 }, [
408
+ g.value.title || g.value.description ? (a(), s("div", Ea, [
409
+ g.value.title ? (a(), s("div", Aa, n(g.value.title), 1)) : v("", !0),
410
+ g.value.description ? (a(), s("p", Ha, n(g.value.description), 1)) : v("", !0)
411
411
  ])) : v("", !0),
412
- g.value.variant === "buttons" ? (a(), s("div", wa, [
413
- (a(!0), s(R, null, ve(Y.value, (r) => (a(), s("button", {
414
- key: r.name || r.label,
412
+ g.value.variant === "buttons" ? (a(), s("div", Ba, [
413
+ (a(!0), s(F, null, de(ee.value, (i) => (a(), s("button", {
414
+ key: i.name || i.label,
415
415
  type: "button",
416
- class: N(["artifactuse-form-btn", `artifactuse-form-btn-${r.variant || "secondary"}`]),
417
- disabled: r.disabled || O.value,
418
- onClick: (B) => Q(r)
416
+ class: I(["artifactuse-form-btn", `artifactuse-form-btn-${i.variant || "secondary"}`]),
417
+ disabled: i.disabled || U.value,
418
+ onClick: (H) => ie(i)
419
419
  }, [
420
- r.icon ? (a(), s("span", {
420
+ i.icon ? (a(), s("span", {
421
421
  key: 0,
422
422
  class: "artifactuse-form-btn-icon",
423
- innerHTML: r.icon
424
- }, null, 8, Ca)) : v("", !0),
425
- K(" " + l(r.label), 1)
426
- ], 10, ba))), 128))
423
+ innerHTML: i.icon
424
+ }, null, 8, za)) : v("", !0),
425
+ Y(" " + n(i.label), 1)
426
+ ], 10, Sa))), 128))
427
427
  ])) : (a(), s("form", {
428
428
  key: 2,
429
429
  class: "artifactuse-form",
430
- onSubmit: he(P, ["prevent"])
430
+ onSubmit: _e(W, ["prevent"])
431
431
  }, [
432
- e("div", xa, [
433
- (a(!0), s(R, null, ve(W.value, (r, B) => (a(), s(R, {
434
- key: r.name || B
432
+ e("div", Va, [
433
+ (a(!0), s(F, null, de(N.value, (i, H) => (a(), s(F, {
434
+ key: i.name || H
435
435
  }, [
436
- r.type === "buttons" ? (a(), s("div", $a, [
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
436
+ i.type === "buttons" ? (a(), s("div", Ia, [
437
+ (a(!0), s(F, null, de(i.fields || [], (d) => (a(), s("button", {
438
+ key: d.name || d.label,
439
+ type: d.action === "submit" ? "submit" : "button",
440
+ class: I(["artifactuse-form-btn", `artifactuse-form-btn-${d.variant || "secondary"}`]),
441
+ disabled: d.disabled || d.action === "submit" && U.value,
442
+ onClick: (L) => d.action !== "submit" ? ie(d) : null
443
443
  }, [
444
- O.value && u.action === "submit" ? (a(), s("span", Ta)) : u.icon ? (a(), s("span", {
444
+ U.value && d.action === "submit" ? (a(), s("span", Ra)) : d.icon ? (a(), s("span", {
445
445
  key: 1,
446
446
  class: "artifactuse-form-btn-icon",
447
- innerHTML: u.icon
448
- }, null, 8, La)) : v("", !0),
449
- K(" " + l(O.value && u.action === "submit" ? "Submitting..." : u.label), 1)
450
- ], 10, Ma))), 128))
451
- ])) : r.type === "divider" ? (a(), s("div", Pa)) : r.type === "heading" ? (a(), s("div", Aa, l(r.label), 1)) : r.type === "checkbox" ? (a(), s("div", Ha, [
452
- e("label", Ea, [
447
+ innerHTML: d.icon
448
+ }, null, 8, qa)) : v("", !0),
449
+ Y(" " + n(U.value && d.action === "submit" ? "Submitting..." : d.label), 1)
450
+ ], 10, Fa))), 128))
451
+ ])) : i.type === "divider" ? (a(), s("div", Oa)) : i.type === "heading" ? (a(), s("div", Ua, n(i.label), 1)) : i.type === "checkbox" ? (a(), s("div", Da, [
452
+ e("label", ja, [
453
453
  e("input", {
454
454
  type: "checkbox",
455
- checked: x.value[r.name],
456
- disabled: r.disabled,
455
+ checked: x.value[i.name],
456
+ disabled: i.disabled,
457
457
  class: "artifactuse-checkbox",
458
- onChange: (u) => k(r.name, u.target.checked)
459
- }, null, 40, Ba),
460
- e("span", Sa, [
461
- K(l(r.label) + " ", 1),
462
- r.required ? (a(), s("span", za, "*")) : v("", !0)
458
+ onChange: (d) => k(i.name, d.target.checked)
459
+ }, null, 40, Na),
460
+ e("span", Wa, [
461
+ Y(n(i.label) + " ", 1),
462
+ i.required ? (a(), s("span", Ja, "*")) : v("", !0)
463
463
  ])
464
464
  ]),
465
- r.helpText ? (a(), s("span", Va, l(r.helpText), 1)) : v("", !0),
466
- j.value[r.name] ? (a(), s("span", Ia, l(j.value[r.name]), 1)) : v("", !0)
467
- ])) : (a(), s("div", Fa, [
465
+ i.helpText ? (a(), s("span", Xa, n(i.helpText), 1)) : v("", !0),
466
+ D.value[i.name] ? (a(), s("span", Za, n(D.value[i.name]), 1)) : v("", !0)
467
+ ])) : (a(), s("div", Ka, [
468
468
  e("label", {
469
- for: `${h.value}-${r.name}`,
469
+ for: `${h.value}-${i.name}`,
470
470
  class: "artifactuse-label"
471
471
  }, [
472
- K(l(r.label) + " ", 1),
473
- r.required ? (a(), s("span", qa, "*")) : v("", !0)
474
- ], 8, Ra),
475
- oe(r.type) ? (a(), s("input", {
472
+ Y(n(i.label) + " ", 1),
473
+ i.required ? (a(), s("span", Qa, "*")) : v("", !0)
474
+ ], 8, Ya),
475
+ ve(i.type) ? (a(), s("input", {
476
476
  key: 0,
477
- id: `${h.value}-${r.name}`,
478
- type: r.type,
479
- value: x.value[r.name],
480
- placeholder: r.placeholder,
481
- disabled: r.disabled,
482
- required: r.required,
477
+ id: `${h.value}-${i.name}`,
478
+ type: i.type,
479
+ value: x.value[i.name],
480
+ placeholder: i.placeholder,
481
+ disabled: i.disabled,
482
+ required: i.required,
483
483
  class: "artifactuse-input",
484
- onInput: (u) => k(r.name, u.target.value)
485
- }, null, 40, Oa)) : r.type === "textarea" ? (a(), s("textarea", {
484
+ onInput: (d) => k(i.name, d.target.value)
485
+ }, null, 40, Ga)) : i.type === "textarea" ? (a(), s("textarea", {
486
486
  key: 1,
487
- id: `${h.value}-${r.name}`,
488
- value: x.value[r.name],
489
- placeholder: r.placeholder,
490
- disabled: r.disabled,
491
- required: r.required,
492
- rows: r.rows || 3,
487
+ id: `${h.value}-${i.name}`,
488
+ value: x.value[i.name],
489
+ placeholder: i.placeholder,
490
+ disabled: i.disabled,
491
+ required: i.required,
492
+ rows: i.rows || 3,
493
493
  class: "artifactuse-textarea",
494
- onInput: (u) => k(r.name, u.target.value)
495
- }, null, 40, Ua)) : r.type === "select" ? (a(), s("select", {
494
+ onInput: (d) => k(i.name, d.target.value)
495
+ }, null, 40, es)) : i.type === "select" ? (a(), s("select", {
496
496
  key: 2,
497
- id: `${h.value}-${r.name}`,
498
- value: x.value[r.name],
499
- disabled: r.disabled,
500
- required: r.required,
497
+ id: `${h.value}-${i.name}`,
498
+ value: x.value[i.name],
499
+ disabled: i.disabled,
500
+ required: i.required,
501
501
  class: "artifactuse-select",
502
- onChange: (u) => k(r.name, u.target.value)
502
+ onChange: (d) => k(i.name, d.target.value)
503
503
  }, [
504
- e("option", ja, l(r.placeholder || "Select..."), 1),
505
- (a(!0), s(R, null, ve(m(r.options), (u) => (a(), s("option", {
506
- key: u.value,
507
- value: u.value,
508
- disabled: u.disabled
509
- }, l(u.label), 9, Na))), 128))
510
- ], 40, Da)) : r.type === "radio" ? (a(), s("div", Wa, [
511
- (a(!0), s(R, null, ve(m(r.options), (u) => (a(), s("label", {
512
- key: u.value,
504
+ e("option", as, n(i.placeholder || "Select..."), 1),
505
+ (a(!0), s(F, null, de(m(i.options), (d) => (a(), s("option", {
506
+ key: d.value,
507
+ value: d.value,
508
+ disabled: d.disabled
509
+ }, n(d.label), 9, ss))), 128))
510
+ ], 40, ts)) : i.type === "radio" ? (a(), s("div", ls, [
511
+ (a(!0), s(F, null, de(m(i.options), (d) => (a(), s("label", {
512
+ key: d.value,
513
513
  class: "artifactuse-radio-label"
514
514
  }, [
515
515
  e("input", {
516
516
  type: "radio",
517
- name: r.name,
518
- value: u.value,
519
- checked: x.value[r.name] === u.value,
520
- disabled: u.disabled || r.disabled,
517
+ name: i.name,
518
+ value: d.value,
519
+ checked: x.value[i.name] === d.value,
520
+ disabled: d.disabled || i.disabled,
521
521
  class: "artifactuse-radio",
522
- onChange: (z) => k(r.name, u.value)
523
- }, null, 40, Ja),
524
- e("span", null, l(u.label), 1)
522
+ onChange: (L) => k(i.name, d.value)
523
+ }, null, 40, is),
524
+ e("span", null, n(d.label), 1)
525
525
  ]))), 128))
526
526
  ])) : v("", !0),
527
- r.helpText ? (a(), s("span", Xa, l(r.helpText), 1)) : v("", !0),
528
- j.value[r.name] ? (a(), s("span", Za, l(j.value[r.name]), 1)) : v("", !0)
527
+ i.helpText ? (a(), s("span", ns, n(i.helpText), 1)) : v("", !0),
528
+ D.value[i.name] ? (a(), s("span", os, n(D.value[i.name]), 1)) : v("", !0)
529
529
  ]))
530
530
  ], 64))), 128))
531
531
  ]),
532
- S.value ? v("", !0) : (a(), s("div", Ka, [
532
+ B.value ? v("", !0) : (a(), s("div", rs, [
533
533
  e("button", {
534
534
  type: "button",
535
535
  class: "artifactuse-form-btn artifactuse-form-btn-ghost",
536
- onClick: L[0] || (L[0] = (r) => Q({ action: "cancel", label: "Cancel" }))
536
+ onClick: E[0] || (E[0] = (i) => ie({ 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: O.value
541
+ disabled: U.value
542
542
  }, [
543
- O.value ? (a(), s("span", Qa)) : v("", !0),
544
- K(" " + l(O.value ? "Submitting..." : "Submit"), 1)
545
- ], 8, Ya)
543
+ U.value ? (a(), s("span", us)) : v("", !0),
544
+ Y(" " + n(U.value ? "Submitting..." : "Submit"), 1)
545
+ ], 8, cs)
546
546
  ]))
547
547
  ], 32))
548
548
  ], 64))
549
- ], 10, da));
549
+ ], 10, Ca));
550
550
  }
551
- }, es = ["data-artifactuse-theme"], ts = { class: "artifactuse-social-header" }, as = ["src", "alt"], ss = { class: "artifactuse-social-author" }, is = { class: "artifactuse-social-author-name" }, ls = { class: "artifactuse-social-author-meta" }, ns = { class: "artifactuse-social-author-handle" }, os = { class: "artifactuse-social-timestamp" }, rs = { class: "artifactuse-social-content" }, cs = ["innerHTML"], us = {
551
+ }, vs = ["data-artifactuse-theme"], fs = { class: "artifactuse-social-header" }, ps = ["src", "alt"], _s = { class: "artifactuse-social-author" }, hs = { class: "artifactuse-social-author-name" }, ms = { class: "artifactuse-social-author-meta" }, ys = { class: "artifactuse-social-author-handle" }, gs = { class: "artifactuse-social-timestamp" }, ks = { class: "artifactuse-social-content" }, ws = ["innerHTML"], bs = {
552
552
  key: 0,
553
553
  class: "artifactuse-social-media"
554
- }, ds = ["data-count"], vs = ["src", "alt"], fs = {
554
+ }, Cs = ["data-count"], xs = ["src", "alt"], $s = {
555
555
  key: 1,
556
556
  class: "artifactuse-social-link-card"
557
- }, ps = ["src", "alt"], _s = { class: "artifactuse-social-link-info" }, hs = { class: "artifactuse-social-link-domain" }, ms = { class: "artifactuse-social-link-title" }, ys = {
557
+ }, Ms = ["src", "alt"], Ts = { class: "artifactuse-social-link-info" }, Ls = { class: "artifactuse-social-link-domain" }, Ps = { class: "artifactuse-social-link-title" }, Es = {
558
558
  key: 0,
559
559
  class: "artifactuse-social-link-description"
560
- }, gs = {
560
+ }, As = {
561
561
  key: 2,
562
562
  class: "artifactuse-social-poll"
563
- }, ks = { class: "artifactuse-social-poll-label" }, ws = { class: "artifactuse-social-poll-label-percent" }, bs = { class: "artifactuse-social-poll-meta" }, Cs = {
563
+ }, Hs = { class: "artifactuse-social-poll-label" }, Bs = { class: "artifactuse-social-poll-label-percent" }, Ss = { class: "artifactuse-social-poll-meta" }, zs = {
564
564
  key: 3,
565
565
  class: "artifactuse-social-quote"
566
- }, xs = { class: "artifactuse-social-quote-header" }, $s = ["src"], Ms = { class: "artifactuse-social-quote-author" }, Ts = { class: "artifactuse-social-quote-handle" }, Ls = { class: "artifactuse-social-quote-text" }, Ps = {
566
+ }, Vs = { class: "artifactuse-social-quote-header" }, Is = ["src"], Fs = { class: "artifactuse-social-quote-author" }, Rs = { class: "artifactuse-social-quote-handle" }, qs = { class: "artifactuse-social-quote-text" }, Os = {
567
567
  key: 0,
568
568
  class: "artifactuse-social-engagement"
569
- }, As = { class: "artifactuse-social-stat" }, Hs = { class: "artifactuse-social-stat" }, Es = { class: "artifactuse-social-stat" }, Bs = { class: "artifactuse-social-stat" }, Ss = { class: "artifactuse-social-header" }, zs = ["src", "alt"], Vs = { class: "artifactuse-social-author-info" }, Is = { class: "artifactuse-social-author-name" }, Fs = {
569
+ }, Us = { class: "artifactuse-social-stat" }, Ds = { class: "artifactuse-social-stat" }, js = { class: "artifactuse-social-stat" }, Ns = { class: "artifactuse-social-stat" }, Ws = { class: "artifactuse-social-header" }, Js = ["src", "alt"], Xs = { class: "artifactuse-social-author-info" }, Zs = { class: "artifactuse-social-author-name" }, Ks = {
570
570
  key: 0,
571
571
  class: "artifactuse-social-author-connection"
572
- }, Rs = { class: "artifactuse-social-author-headline" }, qs = { class: "artifactuse-social-timestamp" }, Os = { class: "artifactuse-social-content" }, Us = ["innerHTML"], Ds = {
572
+ }, Ys = { class: "artifactuse-social-author-headline" }, Qs = { class: "artifactuse-social-timestamp" }, Gs = { class: "artifactuse-social-content" }, el = ["innerHTML"], tl = {
573
573
  key: 0,
574
574
  class: "artifactuse-social-link-card"
575
- }, js = ["src", "alt"], Ns = { class: "artifactuse-social-link-info" }, Ws = { class: "artifactuse-social-link-title" }, Js = { class: "artifactuse-social-link-domain" }, Xs = {
575
+ }, al = ["src", "alt"], sl = { class: "artifactuse-social-link-info" }, ll = { class: "artifactuse-social-link-title" }, il = { class: "artifactuse-social-link-domain" }, nl = {
576
576
  key: 0,
577
577
  class: "artifactuse-social-engagement"
578
- }, Zs = { class: "artifactuse-social-reactions" }, Ks = { class: "artifactuse-social-header" }, Ys = ["src", "alt"], Qs = { class: "artifactuse-social-author-name" }, Gs = {
578
+ }, ol = { class: "artifactuse-social-reactions" }, rl = { class: "artifactuse-social-header" }, cl = ["src", "alt"], ul = { class: "artifactuse-social-author-name" }, dl = {
579
579
  key: 0,
580
580
  class: "artifactuse-social-verified",
581
581
  viewBox: "0 0 24 24",
582
582
  fill: "currentColor"
583
- }, ei = {
583
+ }, vl = {
584
584
  key: 0,
585
585
  class: "artifactuse-social-media"
586
- }, ti = ["src", "alt"], ai = { class: "artifactuse-social-likes" }, si = { class: "artifactuse-social-caption" }, ii = { class: "artifactuse-social-caption-author" }, li = ["innerHTML"], ni = { class: "artifactuse-social-timestamp" }, oi = { class: "artifactuse-social-header" }, ri = ["src", "alt"], ci = { class: "artifactuse-social-author-info" }, ui = { class: "artifactuse-social-author-name" }, di = { class: "artifactuse-social-timestamp" }, vi = { class: "artifactuse-social-content" }, fi = ["innerHTML"], pi = {
586
+ }, fl = ["src", "alt"], pl = { class: "artifactuse-social-likes" }, _l = { class: "artifactuse-social-caption" }, hl = { class: "artifactuse-social-caption-author" }, ml = ["innerHTML"], yl = { class: "artifactuse-social-timestamp" }, gl = { class: "artifactuse-social-header" }, kl = ["src", "alt"], wl = { class: "artifactuse-social-author-info" }, bl = { class: "artifactuse-social-author-name" }, Cl = { class: "artifactuse-social-timestamp" }, xl = { class: "artifactuse-social-content" }, $l = ["innerHTML"], Ml = {
587
587
  key: 0,
588
588
  class: "artifactuse-social-link-card"
589
- }, _i = ["src", "alt"], hi = { class: "artifactuse-social-link-info" }, mi = { class: "artifactuse-social-link-domain" }, yi = { class: "artifactuse-social-link-title" }, gi = {
589
+ }, Tl = ["src", "alt"], Ll = { class: "artifactuse-social-link-info" }, Pl = { class: "artifactuse-social-link-domain" }, El = { class: "artifactuse-social-link-title" }, Al = {
590
590
  key: 0,
591
591
  class: "artifactuse-social-link-description"
592
- }, ki = {
592
+ }, Hl = {
593
593
  key: 0,
594
594
  class: "artifactuse-social-engagement"
595
- }, wi = { class: "artifactuse-social-reactions" }, bi = { class: "artifactuse-social-reaction-count" }, Ci = { class: "artifactuse-social-comments-shares" }, xi = { class: "artifactuse-social-header" }, $i = ["src", "alt"], Mi = { class: "artifactuse-social-author-info" }, Ti = { class: "artifactuse-social-author-name" }, Li = {
595
+ }, Bl = { class: "artifactuse-social-reactions" }, Sl = { class: "artifactuse-social-reaction-count" }, zl = { class: "artifactuse-social-comments-shares" }, Vl = { class: "artifactuse-social-header" }, Il = ["src", "alt"], Fl = { class: "artifactuse-social-author-info" }, Rl = { class: "artifactuse-social-author-name" }, ql = {
596
596
  key: 0,
597
597
  class: "artifactuse-social-verified",
598
598
  viewBox: "0 0 24 24",
599
599
  fill: "currentColor"
600
- }, Pi = { class: "artifactuse-social-timestamp" }, Ai = { class: "artifactuse-social-content" }, Hi = ["innerHTML"], Ei = {
600
+ }, Ol = { class: "artifactuse-social-timestamp" }, Ul = { class: "artifactuse-social-content" }, Dl = ["innerHTML"], jl = {
601
601
  key: 0,
602
602
  class: "artifactuse-social-engagement"
603
- }, Bi = { class: "artifactuse-social-stat" }, Si = { class: "artifactuse-social-stat" }, zi = { class: "artifactuse-social-stat" }, Vi = { class: "artifactuse-social-thumbnail" }, Ii = ["src", "alt"], Fi = {
603
+ }, Nl = { class: "artifactuse-social-stat" }, Wl = { class: "artifactuse-social-stat" }, Jl = { class: "artifactuse-social-stat" }, Xl = { class: "artifactuse-social-thumbnail" }, Zl = ["src", "alt"], Kl = {
604
604
  key: 1,
605
605
  class: "artifactuse-social-duration"
606
- }, Ri = { class: "artifactuse-social-info" }, qi = { class: "artifactuse-social-header" }, Oi = ["src", "alt"], Ui = { class: "artifactuse-social-author-name" }, Di = ["innerHTML"], ji = {
606
+ }, Yl = { class: "artifactuse-social-info" }, Ql = { class: "artifactuse-social-header" }, Gl = ["src", "alt"], ei = { class: "artifactuse-social-author-name" }, ti = ["innerHTML"], ai = {
607
607
  key: 0,
608
608
  class: "artifactuse-social-sound"
609
- }, Ni = {
609
+ }, si = {
610
610
  key: 1,
611
611
  class: "artifactuse-social-engagement"
612
- }, Wi = { class: "artifactuse-social-thumbnail" }, Ji = ["src", "alt"], Xi = {
612
+ }, li = { class: "artifactuse-social-thumbnail" }, ii = ["src", "alt"], ni = {
613
613
  key: 1,
614
614
  class: "artifactuse-social-duration"
615
- }, Zi = { class: "artifactuse-social-info" }, Ki = ["src", "alt"], Yi = { class: "artifactuse-social-title" }, Qi = { class: "artifactuse-social-channel" }, Gi = { class: "artifactuse-social-meta" }, el = { class: "artifactuse-social-actions-bar" }, tl = { 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>', al = {
615
+ }, oi = { class: "artifactuse-social-info" }, ri = ["src", "alt"], ci = { class: "artifactuse-social-title" }, ui = { class: "artifactuse-social-channel" }, di = { class: "artifactuse-social-meta" }, vi = { class: "artifactuse-social-actions-bar" }, fi = { 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>', pi = {
616
616
  __name: "ArtifactuseSocialPreview",
617
617
  props: {
618
618
  artifact: {
@@ -625,37 +625,37 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
625
625
  }
626
626
  },
627
627
  emits: ["copy", "edit"],
628
- setup(H, { emit: c }) {
629
- const _ = H, M = c, f = T(null), o = T("Copy"), q = C(() => {
628
+ setup(P, { emit: c }) {
629
+ const _ = P, T = c, p = M(null), r = M("Copy"), q = b(() => {
630
630
  try {
631
631
  return JSON.parse(_.artifact.code);
632
632
  } catch {
633
633
  return { platform: "twitter", data: {} };
634
634
  }
635
- }), E = C(() => {
635
+ }), A = b(() => {
636
636
  var m;
637
637
  return ((m = q.value) == null ? void 0 : m.platform) || "twitter";
638
638
  });
639
- C(() => {
639
+ b(() => {
640
640
  var m;
641
641
  return ((m = q.value) == null ? void 0 : m.variant) || "post";
642
642
  });
643
- const g = C(() => {
643
+ const g = b(() => {
644
644
  var m, k;
645
645
  return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.author) || {};
646
- }), n = C(() => {
646
+ }), o = b(() => {
647
647
  var m, k;
648
648
  return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.content) || {};
649
- }), h = C(() => {
649
+ }), h = b(() => {
650
650
  var m, k;
651
651
  return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.engagement) || {};
652
- }), $ = C(() => {
652
+ }), $ = b(() => {
653
653
  var m, k;
654
654
  return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.meta) || {};
655
- }), I = C(() => {
655
+ }), V = b(() => {
656
656
  const m = h.value;
657
657
  return m.likes || m.comments || m.shares || m.retweets || m.replies || m.views;
658
- }), x = C(() => `artifactuse-social-verified-${g.value.verifiedType || "blue"}`), j = C(() => ({
658
+ }), x = b(() => `artifactuse-social-verified-${g.value.verifiedType || "blue"}`), D = b(() => ({
659
659
  twitter: "X",
660
660
  linkedin: "LinkedIn",
661
661
  instagram: "Instagram",
@@ -663,127 +663,127 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
663
663
  threads: "Threads",
664
664
  tiktok: "TikTok",
665
665
  youtube: "YouTube"
666
- })[E.value] || E.value), O = C(() => {
666
+ })[A.value] || A.value), U = b(() => {
667
667
  const m = {
668
- twitter: () => se("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
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" })
668
+ twitter: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
669
+ ne("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
  ]),
671
- linkedin: () => se("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
672
- se("path", { d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" })
671
+ linkedin: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
672
+ ne("path", { d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" })
673
673
  ]),
674
- instagram: () => se("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
675
- se("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z" })
674
+ instagram: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
675
+ ne("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z" })
676
676
  ]),
677
- facebook: () => se("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
678
- se("path", { d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" })
677
+ facebook: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
678
+ ne("path", { d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" })
679
679
  ]),
680
- threads: () => se("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
681
- se("path", { d: "M12.186 24h-.007c-3.581-.024-6.334-1.205-8.184-3.509C2.35 18.44 1.5 15.586 1.472 12.01v-.017c.03-3.579.879-6.43 2.525-8.482C5.845 1.205 8.6.024 12.18 0h.014c2.746.02 5.043.725 6.826 2.098 1.677 1.29 2.858 3.13 3.509 5.467l-2.04.569c-1.104-3.96-3.898-5.984-8.304-6.015-2.91.022-5.11.936-6.54 2.717C4.307 6.504 3.616 8.914 3.59 12c.025 3.086.718 5.496 2.057 7.164 1.43 1.783 3.631 2.698 6.54 2.717 2.623-.02 4.358-.631 5.8-2.045 1.647-1.613 1.618-3.593 1.09-4.798-.31-.71-.873-1.3-1.634-1.75-.192 1.352-.622 2.446-1.284 3.272-.886 1.102-2.14 1.704-3.73 1.79-1.202.065-2.361-.218-3.259-.801-1.063-.689-1.685-1.74-1.752-2.96-.065-1.182.408-2.256 1.33-3.022.88-.73 2.108-1.152 3.457-1.187 1.357-.035 2.573.283 3.58.89.034-.497.04-1.017.015-1.558-.083-1.792-.648-3.095-1.68-3.876-.99-.75-2.453-1.123-4.35-1.108-.987.008-1.866.09-2.613.246l-.464-2.086c.912-.19 1.965-.29 3.133-.298 2.467-.02 4.42.554 5.807 1.706 1.46 1.213 2.24 3.007 2.354 5.411.039.827.026 1.69-.04 2.576.962.681 1.735 1.542 2.268 2.553.846 1.6 1.026 3.639.508 5.622-.57 2.181-1.782 3.94-3.503 5.079C17.194 23.394 14.88 24 12.186 24zM9.15 13.476c-.927.037-1.628.282-2.085.728-.418.408-.618.945-.578 1.553.04.638.347 1.165.866 1.483.586.36 1.39.521 2.266.45 1.053-.085 1.86-.473 2.4-1.153.457-.576.763-1.39.884-2.356-.893-.41-1.944-.636-3.095-.705h-.009c-.216-.008-.436-.008-.65 0z" })
680
+ threads: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
681
+ ne("path", { d: "M12.186 24h-.007c-3.581-.024-6.334-1.205-8.184-3.509C2.35 18.44 1.5 15.586 1.472 12.01v-.017c.03-3.579.879-6.43 2.525-8.482C5.845 1.205 8.6.024 12.18 0h.014c2.746.02 5.043.725 6.826 2.098 1.677 1.29 2.858 3.13 3.509 5.467l-2.04.569c-1.104-3.96-3.898-5.984-8.304-6.015-2.91.022-5.11.936-6.54 2.717C4.307 6.504 3.616 8.914 3.59 12c.025 3.086.718 5.496 2.057 7.164 1.43 1.783 3.631 2.698 6.54 2.717 2.623-.02 4.358-.631 5.8-2.045 1.647-1.613 1.618-3.593 1.09-4.798-.31-.71-.873-1.3-1.634-1.75-.192 1.352-.622 2.446-1.284 3.272-.886 1.102-2.14 1.704-3.73 1.79-1.202.065-2.361-.218-3.259-.801-1.063-.689-1.685-1.74-1.752-2.96-.065-1.182.408-2.256 1.33-3.022.88-.73 2.108-1.152 3.457-1.187 1.357-.035 2.573.283 3.58.89.034-.497.04-1.017.015-1.558-.083-1.792-.648-3.095-1.68-3.876-.99-.75-2.453-1.123-4.35-1.108-.987.008-1.866.09-2.613.246l-.464-2.086c.912-.19 1.965-.29 3.133-.298 2.467-.02 4.42.554 5.807 1.706 1.46 1.213 2.24 3.007 2.354 5.411.039.827.026 1.69-.04 2.576.962.681 1.735 1.542 2.268 2.553.846 1.6 1.026 3.639.508 5.622-.57 2.181-1.782 3.94-3.503 5.079C17.194 23.394 14.88 24 12.186 24zM9.15 13.476c-.927.037-1.628.282-2.085.728-.418.408-.618.945-.578 1.553.04.638.347 1.165.866 1.483.586.36 1.39.521 2.266.45 1.053-.085 1.86-.473 2.4-1.153.457-.576.763-1.39.884-2.356-.893-.41-1.944-.636-3.095-.705h-.009c-.216-.008-.436-.008-.65 0z" })
682
682
  ]),
683
- tiktok: () => se("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
684
- se("path", { d: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z" })
683
+ tiktok: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
684
+ ne("path", { d: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z" })
685
685
  ]),
686
- youtube: () => se("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
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" })
686
+ youtube: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
687
+ ne("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 m[E.value] || m.twitter;
691
- }), W = C(() => {
692
- let m = n.value.text || "";
690
+ return m[A.value] || m.twitter;
691
+ }), N = b(() => {
692
+ let m = o.value.text || "";
693
693
  return m = m.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), m = m.replace(/#(\w+)/g, '<span class="artifactuse-social-hashtag">#$1</span>'), m = m.replace(/@(\w+)/g, '<span class="artifactuse-social-mention">@$1</span>'), m = m.replace(
694
694
  /(https?:\/\/[^\s]+)/g,
695
695
  '<a href="$1" target="_blank" rel="noopener">$1</a>'
696
696
  ), m;
697
- }), Y = C(() => {
697
+ }), ee = b(() => {
698
698
  const m = h.value.reactions || {};
699
- return Object.values(m).reduce((k, ee) => k + (ee || 0), 0) || h.value.likes || 0;
699
+ return Object.values(m).reduce((k, ae) => k + (ae || 0), 0) || h.value.likes || 0;
700
700
  });
701
- function S(m) {
701
+ function B(m) {
702
702
  return m ? m >= 1e6 ? `${(m / 1e6).toFixed(1)}M` : m >= 1e3 ? `${(m / 1e3).toFixed(1)}K` : m.toString() : "0";
703
703
  }
704
- function ie(m) {
704
+ function re(m) {
705
705
  try {
706
706
  return new URL(m).hostname.replace("www.", "");
707
707
  } catch {
708
708
  return m;
709
709
  }
710
710
  }
711
- function Z(m) {
712
- m.target.src = _e;
711
+ function K(m) {
712
+ m.target.src = he;
713
713
  }
714
- function X(m) {
714
+ function Z(m) {
715
715
  m.target.style.display = "none";
716
716
  }
717
- function oe() {
718
- const m = n.value.text || "";
717
+ function ve() {
718
+ const m = o.value.text || "";
719
719
  navigator.clipboard.writeText(m).then(() => {
720
- o.value = "Copied!", setTimeout(() => {
721
- o.value = "Copy";
722
- }, 2e3), M("copy", { platform: E.value, text: m });
720
+ r.value = "Copied!", setTimeout(() => {
721
+ r.value = "Copy";
722
+ }, 2e3), T("copy", { platform: A.value, text: m });
723
723
  });
724
724
  }
725
725
  return (m, k) => {
726
- var ee, re, P, Q, w, L;
726
+ var ae, Q, W, ie, w, E;
727
727
  return a(), s("div", {
728
728
  ref_key: "containerRef",
729
- ref: f,
730
- class: N(["artifactuse-social", [`artifactuse-social-${E.value}`]]),
731
- "data-artifactuse-theme": H.theme
729
+ ref: p,
730
+ class: I(["artifactuse-social", [`artifactuse-social-${A.value}`]]),
731
+ "data-artifactuse-theme": P.theme
732
732
  }, [
733
- E.value === "twitter" ? (a(), s(R, { key: 0 }, [
734
- e("div", ts, [
733
+ A.value === "twitter" ? (a(), s(F, { key: 0 }, [
734
+ e("div", fs, [
735
735
  e("img", {
736
- src: g.value.avatar || _e,
736
+ src: g.value.avatar || he,
737
737
  alt: g.value.name,
738
738
  class: "artifactuse-social-avatar",
739
- onError: Z
740
- }, null, 40, as),
741
- e("div", ss, [
742
- e("div", is, [
743
- e("span", null, l(g.value.name), 1),
739
+ onError: K
740
+ }, null, 40, ps),
741
+ e("div", _s, [
742
+ e("div", hs, [
743
+ e("span", null, n(g.value.name), 1),
744
744
  g.value.verified ? (a(), s("svg", {
745
745
  key: 0,
746
- class: N(["artifactuse-social-verified", x.value]),
746
+ class: I(["artifactuse-social-verified", x.value]),
747
747
  viewBox: "0 0 24 24",
748
748
  fill: "currentColor"
749
749
  }, [...k[0] || (k[0] = [
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", ls, [
754
- e("span", ns, l(g.value.handle), 1),
755
- e("span", os, "· " + l($.value.timestamp || "Just now"), 1)
753
+ e("div", ms, [
754
+ e("span", ys, n(g.value.handle), 1),
755
+ e("span", gs, "· " + n($.value.timestamp || "Just now"), 1)
756
756
  ])
757
757
  ])
758
758
  ]),
759
- e("div", rs, [
759
+ e("div", ks, [
760
760
  e("p", {
761
761
  class: "artifactuse-social-text",
762
- innerHTML: W.value
763
- }, null, 8, cs),
764
- (ee = n.value.media) != null && ee.length ? (a(), s("div", us, [
762
+ innerHTML: N.value
763
+ }, null, 8, ws),
764
+ (ae = o.value.media) != null && ae.length ? (a(), s("div", bs, [
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: I(["artifactuse-social-media-grid", { "artifactuse-social-media-single": o.value.media.length === 1 }]),
767
+ "data-count": o.value.media.length
768
768
  }, [
769
- (a(!0), s(R, null, ve(n.value.media.slice(0, 4), (r, B) => (a(), s("img", {
770
- key: B,
771
- src: r.url,
772
- alt: r.alt || "",
773
- onError: X
774
- }, null, 40, vs))), 128))
775
- ], 10, ds)
769
+ (a(!0), s(F, null, de(o.value.media.slice(0, 4), (i, H) => (a(), s("img", {
770
+ key: H,
771
+ src: i.url,
772
+ alt: i.alt || "",
773
+ onError: Z
774
+ }, null, 40, xs))), 128))
775
+ ], 10, Cs)
776
776
  ])) : v("", !0),
777
- n.value.link && !((re = n.value.media) != null && re.length) ? (a(), s("div", fs, [
778
- n.value.link.image ? (a(), s("img", {
777
+ o.value.link && !((Q = o.value.media) != null && Q.length) ? (a(), s("div", $s, [
778
+ o.value.link.image ? (a(), s("img", {
779
779
  key: 0,
780
- src: n.value.link.image,
781
- alt: n.value.link.title,
780
+ src: o.value.link.image,
781
+ alt: o.value.link.title,
782
782
  class: "artifactuse-social-link-image",
783
- onError: X
784
- }, null, 40, ps)) : v("", !0),
785
- e("div", _s, [
786
- e("div", hs, [
783
+ onError: Z
784
+ }, null, 40, Ms)) : v("", !0),
785
+ e("div", Ts, [
786
+ e("div", Ls, [
787
787
  k[1] || (k[1] = e("svg", {
788
788
  fill: "none",
789
789
  viewBox: "0 0 24 24",
@@ -796,45 +796,45 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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
+ Y(" " + n(o.value.link.domain || re(o.value.link.url)), 1)
800
800
  ]),
801
- e("div", ms, l(n.value.link.title), 1),
802
- n.value.link.description ? (a(), s("div", ys, l(n.value.link.description), 1)) : v("", !0)
801
+ e("div", Ps, n(o.value.link.title), 1),
802
+ o.value.link.description ? (a(), s("div", Es, n(o.value.link.description), 1)) : v("", !0)
803
803
  ])
804
804
  ])) : v("", !0),
805
- n.value.poll ? (a(), s("div", gs, [
806
- (a(!0), s(R, null, ve(n.value.poll.options, (r, B) => {
807
- var u, z;
805
+ o.value.poll ? (a(), s("div", As, [
806
+ (a(!0), s(F, null, de(o.value.poll.options, (i, H) => {
807
+ var d, L;
808
808
  return a(), s("div", {
809
- key: B,
809
+ key: H,
810
810
  class: "artifactuse-social-poll-option"
811
811
  }, [
812
812
  e("div", {
813
813
  class: "artifactuse-social-poll-bar",
814
- style: He({ width: `${((u = n.value.poll.votes) == null ? void 0 : u[B]) || 0}%` })
814
+ style: Se({ width: `${((d = o.value.poll.votes) == null ? void 0 : d[H]) || 0}%` })
815
815
  }, null, 4),
816
- e("div", ks, [
817
- e("span", null, l(r), 1),
818
- e("span", ws, l(((z = n.value.poll.votes) == null ? void 0 : z[B]) || 0) + "%", 1)
816
+ e("div", Hs, [
817
+ e("span", null, n(i), 1),
818
+ e("span", Bs, n(((L = o.value.poll.votes) == null ? void 0 : L[H]) || 0) + "%", 1)
819
819
  ])
820
820
  ]);
821
821
  }), 128)),
822
- e("div", bs, l(S(n.value.poll.totalVotes || 0)) + " votes · " + l(n.value.poll.duration || "Poll ended"), 1)
822
+ e("div", Ss, n(B(o.value.poll.totalVotes || 0)) + " votes · " + n(o.value.poll.duration || "Poll ended"), 1)
823
823
  ])) : v("", !0),
824
- n.value.quote ? (a(), s("div", Cs, [
825
- e("div", xs, [
824
+ o.value.quote ? (a(), s("div", zs, [
825
+ e("div", Vs, [
826
826
  e("img", {
827
- src: ((P = n.value.quote.author) == null ? void 0 : P.avatar) || _e,
827
+ src: ((W = o.value.quote.author) == null ? void 0 : W.avatar) || he,
828
828
  class: "artifactuse-social-quote-avatar"
829
- }, null, 8, $s),
830
- e("span", Ms, l((Q = n.value.quote.author) == null ? void 0 : Q.name), 1),
831
- e("span", Ts, l((w = n.value.quote.author) == null ? void 0 : w.handle), 1)
829
+ }, null, 8, Is),
830
+ e("span", Fs, n((ie = o.value.quote.author) == null ? void 0 : ie.name), 1),
831
+ e("span", Rs, n((w = o.value.quote.author) == null ? void 0 : w.handle), 1)
832
832
  ]),
833
- e("p", Ls, l(n.value.quote.text), 1)
833
+ e("p", qs, n(o.value.quote.text), 1)
834
834
  ])) : v("", !0)
835
835
  ]),
836
- I.value ? (a(), s("div", Ps, [
837
- e("div", As, [
836
+ V.value ? (a(), s("div", Os, [
837
+ e("div", Us, [
838
838
  k[2] || (k[2] = e("svg", {
839
839
  viewBox: "0 0 24 24",
840
840
  fill: "none",
@@ -843,9 +843,9 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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(S(h.value.replies || 0)), 1)
846
+ e("span", null, n(B(h.value.replies || 0)), 1)
847
847
  ]),
848
- e("div", Hs, [
848
+ e("div", Ds, [
849
849
  k[3] || (k[3] = e("svg", {
850
850
  viewBox: "0 0 24 24",
851
851
  fill: "none",
@@ -854,9 +854,9 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
854
854
  }, [
855
855
  e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
856
856
  ], -1)),
857
- e("span", null, l(S(h.value.retweets || 0)), 1)
857
+ e("span", null, n(B(h.value.retweets || 0)), 1)
858
858
  ]),
859
- e("div", Es, [
859
+ e("div", js, [
860
860
  k[4] || (k[4] = e("svg", {
861
861
  viewBox: "0 0 24 24",
862
862
  fill: "none",
@@ -865,9 +865,9 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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(S(h.value.likes || 0)), 1)
868
+ e("span", null, n(B(h.value.likes || 0)), 1)
869
869
  ]),
870
- e("div", Bs, [
870
+ e("div", Ns, [
871
871
  k[5] || (k[5] = e("svg", {
872
872
  viewBox: "0 0 24 24",
873
873
  fill: "none",
@@ -876,25 +876,25 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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(S(h.value.views || 0)), 1)
879
+ e("span", null, n(B(h.value.views || 0)), 1)
880
880
  ])
881
881
  ])) : v("", !0)
882
- ], 64)) : E.value === "linkedin" ? (a(), s(R, { key: 1 }, [
883
- e("div", Ss, [
882
+ ], 64)) : A.value === "linkedin" ? (a(), s(F, { key: 1 }, [
883
+ e("div", Ws, [
884
884
  e("img", {
885
- src: g.value.avatar || _e,
885
+ src: g.value.avatar || he,
886
886
  alt: g.value.name,
887
887
  class: "artifactuse-social-avatar",
888
- onError: Z
889
- }, null, 40, zs),
890
- e("div", Vs, [
891
- e("div", Is, [
892
- K(l(g.value.name) + " ", 1),
893
- g.value.connection ? (a(), s("span", Fs, "· " + l(g.value.connection), 1)) : v("", !0)
888
+ onError: K
889
+ }, null, 40, Js),
890
+ e("div", Xs, [
891
+ e("div", Zs, [
892
+ Y(n(g.value.name) + " ", 1),
893
+ g.value.connection ? (a(), s("span", Ks, "· " + n(g.value.connection), 1)) : v("", !0)
894
894
  ]),
895
- e("div", Rs, l(g.value.headline), 1),
896
- e("div", qs, [
897
- K(l($.value.timestamp || "Just now") + " · ", 1),
895
+ e("div", Ys, n(g.value.headline), 1),
896
+ e("div", Qs, [
897
+ Y(n($.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 Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
904
904
  ])
905
905
  ])
906
906
  ]),
907
- e("div", Os, [
907
+ e("div", Gs, [
908
908
  e("p", {
909
909
  class: "artifactuse-social-text",
910
- innerHTML: W.value
911
- }, null, 8, Us),
912
- n.value.link ? (a(), s("div", Ds, [
913
- n.value.link.image ? (a(), s("img", {
910
+ innerHTML: N.value
911
+ }, null, 8, el),
912
+ o.value.link ? (a(), s("div", tl, [
913
+ o.value.link.image ? (a(), s("img", {
914
914
  key: 0,
915
- src: n.value.link.image,
916
- alt: n.value.link.title,
915
+ src: o.value.link.image,
916
+ alt: o.value.link.title,
917
917
  class: "artifactuse-social-link-image",
918
- onError: X
919
- }, null, 40, js)) : v("", !0),
920
- e("div", Ns, [
921
- e("div", Ws, l(n.value.link.title), 1),
922
- e("div", Js, l(n.value.link.domain || ie(n.value.link.url)), 1)
918
+ onError: Z
919
+ }, null, 40, al)) : v("", !0),
920
+ e("div", sl, [
921
+ e("div", ll, n(o.value.link.title), 1),
922
+ e("div", il, n(o.value.link.domain || re(o.value.link.url)), 1)
923
923
  ])
924
924
  ])) : v("", !0)
925
925
  ]),
926
- I.value ? (a(), s("div", Xs, [
927
- e("div", Zs, [
926
+ V.value ? (a(), s("div", nl, [
927
+ e("div", ol, [
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(S(h.value.likes || 0)), 1)
933
+ e("span", null, n(B(h.value.likes || 0)), 1)
934
934
  ]),
935
- e("span", null, l(S(h.value.comments || 0)) + " comments · " + l(S(h.value.shares || 0)) + " shares", 1)
935
+ e("span", null, n(B(h.value.comments || 0)) + " comments · " + n(B(h.value.shares || 0)) + " shares", 1)
936
936
  ])) : v("", !0)
937
- ], 64)) : E.value === "instagram" ? (a(), s(R, { key: 2 }, [
938
- e("div", Ks, [
937
+ ], 64)) : A.value === "instagram" ? (a(), s(F, { key: 2 }, [
938
+ e("div", rl, [
939
939
  e("img", {
940
- src: g.value.avatar || _e,
940
+ src: g.value.avatar || he,
941
941
  alt: g.value.name,
942
942
  class: "artifactuse-social-avatar",
943
- onError: Z
944
- }, null, 40, Ys),
945
- e("div", Qs, [
946
- K(l(g.value.name) + " ", 1),
947
- g.value.verified ? (a(), s("svg", Gs, [...k[8] || (k[8] = [
943
+ onError: K
944
+ }, null, 40, cl),
945
+ e("div", ul, [
946
+ Y(n(g.value.name) + " ", 1),
947
+ g.value.verified ? (a(), s("svg", dl, [...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
- (L = n.value.media) != null && L.length ? (a(), s("div", ei, [
952
+ (E = o.value.media) != null && E.length ? (a(), s("div", vl, [
953
953
  e("img", {
954
- src: n.value.media[0].url,
955
- alt: n.value.media[0].alt || "",
956
- onError: X
957
- }, null, 40, ti)
954
+ src: o.value.media[0].url,
955
+ alt: o.value.media[0].alt || "",
956
+ onError: Z
957
+ }, null, 40, fl)
958
958
  ])) : v("", !0),
959
- k[9] || (k[9] = Ut('<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", ai, l(S(h.value.likes || 0)) + " likes", 1),
961
- e("div", si, [
962
- e("span", ii, l(g.value.name), 1),
959
+ k[9] || (k[9] = ea('<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", pl, n(B(h.value.likes || 0)) + " likes", 1),
961
+ e("div", _l, [
962
+ e("span", hl, n(g.value.name), 1),
963
963
  e("span", {
964
964
  class: "artifactuse-social-caption-text",
965
- innerHTML: W.value
966
- }, null, 8, li)
965
+ innerHTML: N.value
966
+ }, null, 8, ml)
967
967
  ]),
968
- e("div", ni, l($.value.timestamp || "Just now"), 1)
969
- ], 64)) : E.value === "facebook" ? (a(), s(R, { key: 3 }, [
970
- e("div", oi, [
968
+ e("div", yl, n($.value.timestamp || "Just now"), 1)
969
+ ], 64)) : A.value === "facebook" ? (a(), s(F, { key: 3 }, [
970
+ e("div", gl, [
971
971
  e("img", {
972
- src: g.value.avatar || _e,
972
+ src: g.value.avatar || he,
973
973
  alt: g.value.name,
974
974
  class: "artifactuse-social-avatar",
975
- onError: Z
976
- }, null, 40, ri),
977
- e("div", ci, [
978
- e("div", ui, l(g.value.name), 1),
979
- e("div", di, [
980
- K(l($.value.timestamp || "Just now") + " · ", 1),
975
+ onError: K
976
+ }, null, 40, kl),
977
+ e("div", wl, [
978
+ e("div", bl, n(g.value.name), 1),
979
+ e("div", Cl, [
980
+ Y(n($.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 Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
987
987
  ])
988
988
  ])
989
989
  ]),
990
- e("div", vi, [
990
+ e("div", xl, [
991
991
  e("p", {
992
992
  class: "artifactuse-social-text",
993
- innerHTML: W.value
994
- }, null, 8, fi),
995
- n.value.link ? (a(), s("div", pi, [
996
- n.value.link.image ? (a(), s("img", {
993
+ innerHTML: N.value
994
+ }, null, 8, $l),
995
+ o.value.link ? (a(), s("div", Ml, [
996
+ o.value.link.image ? (a(), s("img", {
997
997
  key: 0,
998
- src: n.value.link.image,
999
- alt: n.value.link.title,
998
+ src: o.value.link.image,
999
+ alt: o.value.link.title,
1000
1000
  class: "artifactuse-social-link-image",
1001
- onError: X
1002
- }, null, 40, _i)) : v("", !0),
1003
- e("div", hi, [
1004
- e("div", mi, l(n.value.link.domain || ie(n.value.link.url)), 1),
1005
- e("div", yi, l(n.value.link.title), 1),
1006
- n.value.link.description ? (a(), s("div", gi, l(n.value.link.description), 1)) : v("", !0)
1001
+ onError: Z
1002
+ }, null, 40, Tl)) : v("", !0),
1003
+ e("div", Ll, [
1004
+ e("div", Pl, n(o.value.link.domain || re(o.value.link.url)), 1),
1005
+ e("div", El, n(o.value.link.title), 1),
1006
+ o.value.link.description ? (a(), s("div", Al, n(o.value.link.description), 1)) : v("", !0)
1007
1007
  ])
1008
1008
  ])) : v("", !0)
1009
1009
  ]),
1010
- I.value ? (a(), s("div", ki, [
1011
- e("div", wi, [
1010
+ V.value ? (a(), s("div", Hl, [
1011
+ e("div", Bl, [
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", bi, l(S(Y.value)), 1)
1017
+ e("span", Sl, n(B(ee.value)), 1)
1018
1018
  ]),
1019
- e("span", Ci, l(S(h.value.comments || 0)) + " comments · " + l(S(h.value.shares || 0)) + " shares", 1)
1019
+ e("span", zl, n(B(h.value.comments || 0)) + " comments · " + n(B(h.value.shares || 0)) + " shares", 1)
1020
1020
  ])) : v("", !0)
1021
- ], 64)) : E.value === "threads" ? (a(), s(R, { key: 4 }, [
1022
- e("div", xi, [
1021
+ ], 64)) : A.value === "threads" ? (a(), s(F, { key: 4 }, [
1022
+ e("div", Vl, [
1023
1023
  e("img", {
1024
- src: g.value.avatar || _e,
1024
+ src: g.value.avatar || he,
1025
1025
  alt: g.value.name,
1026
1026
  class: "artifactuse-social-avatar",
1027
- onError: Z
1028
- }, null, 40, $i),
1029
- e("div", Mi, [
1030
- e("div", Ti, [
1031
- K(l(g.value.name) + " ", 1),
1032
- g.value.verified ? (a(), s("svg", Li, [...k[12] || (k[12] = [
1027
+ onError: K
1028
+ }, null, 40, Il),
1029
+ e("div", Fl, [
1030
+ e("div", Rl, [
1031
+ Y(n(g.value.name) + " ", 1),
1032
+ g.value.verified ? (a(), s("svg", ql, [...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", Pi, l($.value.timestamp || "Just now"), 1)
1036
+ e("span", Ol, n($.value.timestamp || "Just now"), 1)
1037
1037
  ])
1038
1038
  ]),
1039
- e("div", Ai, [
1039
+ e("div", Ul, [
1040
1040
  e("p", {
1041
1041
  class: "artifactuse-social-text",
1042
- innerHTML: W.value
1043
- }, null, 8, Hi)
1042
+ innerHTML: N.value
1043
+ }, null, 8, Dl)
1044
1044
  ]),
1045
- I.value ? (a(), s("div", Ei, [
1046
- e("div", Bi, [
1045
+ V.value ? (a(), s("div", jl, [
1046
+ e("div", Nl, [
1047
1047
  k[13] || (k[13] = e("svg", {
1048
1048
  viewBox: "0 0 24 24",
1049
1049
  fill: "none",
@@ -1052,9 +1052,9 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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(S(h.value.likes || 0)), 1)
1055
+ e("span", null, n(B(h.value.likes || 0)), 1)
1056
1056
  ]),
1057
- e("div", Si, [
1057
+ e("div", Wl, [
1058
1058
  k[14] || (k[14] = e("svg", {
1059
1059
  viewBox: "0 0 24 24",
1060
1060
  fill: "none",
@@ -1063,9 +1063,9 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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(S(h.value.comments || 0)), 1)
1066
+ e("span", null, n(B(h.value.comments || 0)), 1)
1067
1067
  ]),
1068
- e("div", zi, [
1068
+ e("div", Jl, [
1069
1069
  k[15] || (k[15] = e("svg", {
1070
1070
  viewBox: "0 0 24 24",
1071
1071
  fill: "none",
@@ -1074,17 +1074,17 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
1074
1074
  }, [
1075
1075
  e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
1076
1076
  ], -1)),
1077
- e("span", null, l(S(h.value.shares || 0)), 1)
1077
+ e("span", null, n(B(h.value.shares || 0)), 1)
1078
1078
  ])
1079
1079
  ])) : v("", !0)
1080
- ], 64)) : E.value === "tiktok" ? (a(), s(R, { key: 5 }, [
1081
- e("div", Vi, [
1082
- n.value.thumbnail ? (a(), s("img", {
1080
+ ], 64)) : A.value === "tiktok" ? (a(), s(F, { key: 5 }, [
1081
+ e("div", Xl, [
1082
+ o.value.thumbnail ? (a(), s("img", {
1083
1083
  key: 0,
1084
- src: n.value.thumbnail,
1085
- alt: n.value.text,
1086
- onError: X
1087
- }, null, 40, Ii)) : v("", !0),
1084
+ src: o.value.thumbnail,
1085
+ alt: o.value.text,
1086
+ onError: Z
1087
+ }, null, 40, Zl)) : 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,69 +1095,69 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
1095
1095
  ])
1096
1096
  ])
1097
1097
  ], -1)),
1098
- n.value.duration ? (a(), s("div", Fi, l(n.value.duration), 1)) : v("", !0)
1098
+ o.value.duration ? (a(), s("div", Kl, n(o.value.duration), 1)) : v("", !0)
1099
1099
  ]),
1100
- e("div", Ri, [
1101
- e("div", qi, [
1100
+ e("div", Yl, [
1101
+ e("div", Ql, [
1102
1102
  e("img", {
1103
- src: g.value.avatar || _e,
1103
+ src: g.value.avatar || he,
1104
1104
  alt: g.value.name,
1105
1105
  class: "artifactuse-social-avatar",
1106
- onError: Z
1107
- }, null, 40, Oi),
1108
- e("span", Ui, l(g.value.name), 1)
1106
+ onError: K
1107
+ }, null, 40, Gl),
1108
+ e("span", ei, n(g.value.name), 1)
1109
1109
  ]),
1110
1110
  e("p", {
1111
1111
  class: "artifactuse-social-text",
1112
- innerHTML: W.value
1113
- }, null, 8, Di),
1114
- n.value.sound ? (a(), s("div", ji, [
1112
+ innerHTML: N.value
1113
+ }, null, 8, ti),
1114
+ o.value.sound ? (a(), s("div", ai, [
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
+ Y(" " + n(o.value.sound), 1)
1122
1122
  ])) : v("", !0),
1123
- I.value ? (a(), s("div", Ni, [
1124
- e("span", null, l(S(h.value.likes || 0)) + " likes", 1),
1125
- e("span", null, l(S(h.value.comments || 0)) + " comments", 1),
1126
- e("span", null, l(S(h.value.shares || 0)) + " shares", 1)
1123
+ V.value ? (a(), s("div", si, [
1124
+ e("span", null, n(B(h.value.likes || 0)) + " likes", 1),
1125
+ e("span", null, n(B(h.value.comments || 0)) + " comments", 1),
1126
+ e("span", null, n(B(h.value.shares || 0)) + " shares", 1)
1127
1127
  ])) : v("", !0)
1128
1128
  ])
1129
- ], 64)) : E.value === "youtube" ? (a(), s(R, { key: 6 }, [
1130
- e("div", Wi, [
1131
- n.value.thumbnail ? (a(), s("img", {
1129
+ ], 64)) : A.value === "youtube" ? (a(), s(F, { key: 6 }, [
1130
+ e("div", li, [
1131
+ o.value.thumbnail ? (a(), s("img", {
1132
1132
  key: 0,
1133
- src: n.value.thumbnail,
1134
- alt: n.value.title,
1135
- onError: X
1136
- }, null, 40, Ji)) : v("", !0),
1137
- n.value.duration ? (a(), s("div", Xi, l(n.value.duration), 1)) : v("", !0)
1133
+ src: o.value.thumbnail,
1134
+ alt: o.value.title,
1135
+ onError: Z
1136
+ }, null, 40, ii)) : v("", !0),
1137
+ o.value.duration ? (a(), s("div", ni, n(o.value.duration), 1)) : v("", !0)
1138
1138
  ]),
1139
- e("div", Zi, [
1139
+ e("div", oi, [
1140
1140
  e("img", {
1141
- src: g.value.avatar || _e,
1141
+ src: g.value.avatar || he,
1142
1142
  alt: g.value.name,
1143
1143
  class: "artifactuse-social-avatar",
1144
- onError: Z
1145
- }, null, 40, Ki),
1144
+ onError: K
1145
+ }, null, 40, ri),
1146
1146
  e("div", null, [
1147
- e("div", Yi, l(n.value.title || n.value.text), 1),
1148
- e("div", Qi, l(g.value.name), 1),
1149
- e("div", Gi, l(S(h.value.views || 0)) + " views · " + l($.value.timestamp || "Just now"), 1)
1147
+ e("div", ci, n(o.value.title || o.value.text), 1),
1148
+ e("div", ui, n(g.value.name), 1),
1149
+ e("div", di, n(B(h.value.views || 0)) + " views · " + n($.value.timestamp || "Just now"), 1)
1150
1150
  ])
1151
1151
  ])
1152
1152
  ], 64)) : v("", !0),
1153
- e("div", el, [
1154
- e("div", tl, [
1155
- (a(), xe(Dt(O.value))),
1156
- e("span", null, l(j.value), 1)
1153
+ e("div", vi, [
1154
+ e("div", fi, [
1155
+ (a(), Me(ta(U.value))),
1156
+ e("span", null, n(D.value), 1)
1157
1157
  ]),
1158
1158
  e("button", {
1159
1159
  class: "artifactuse-social-copy-btn",
1160
- onClick: oe
1160
+ onClick: ve
1161
1161
  }, [
1162
1162
  k[18] || (k[18] = e("svg", {
1163
1163
  viewBox: "0 0 24 24",
@@ -1175,31 +1175,31 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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(o.value), 1)
1178
+ Y(" " + n(r.value), 1)
1179
1179
  ])
1180
1180
  ])
1181
- ], 10, es);
1181
+ ], 10, vs);
1182
1182
  };
1183
1183
  }
1184
- }, sl = ["src", "alt"], il = ["src"], ll = {
1184
+ }, _i = ["src", "alt"], hi = ["src"], mi = {
1185
1185
  key: 2,
1186
1186
  class: "artifactuse-viewer-controls"
1187
- }, nl = ["title"], ol = {
1187
+ }, yi = ["title"], gi = {
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
- }, rl = {
1193
+ }, ki = {
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
- }, cl = {
1199
+ }, wi = {
1200
1200
  key: 3,
1201
1201
  class: "artifactuse-viewer-caption"
1202
- }, ul = {
1202
+ }, bi = {
1203
1203
  __name: "ArtifactuseViewer",
1204
1204
  props: {
1205
1205
  // Whether the viewer is open
@@ -1229,58 +1229,58 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
1229
1229
  }
1230
1230
  },
1231
1231
  emits: ["close"],
1232
- setup(H, { emit: c }) {
1233
- const _ = H, M = c, f = T(null), o = T(!1);
1232
+ setup(P, { emit: c }) {
1233
+ const _ = P, T = c, p = M(null), r = M(!1);
1234
1234
  function q() {
1235
- o.value = !1, M("close");
1235
+ r.value = !1, T("close");
1236
1236
  }
1237
- function E() {
1238
- _.type === "image" && (o.value = !o.value);
1237
+ function A() {
1238
+ _.type === "image" && (r.value = !r.value);
1239
1239
  }
1240
1240
  function g() {
1241
1241
  const h = document.createElement("a");
1242
1242
  h.href = _.src, h.download = _.alt || "download", document.body.appendChild(h), h.click(), document.body.removeChild(h);
1243
1243
  }
1244
- function n(h) {
1244
+ function o(h) {
1245
1245
  h.key === "Escape" && _.isOpen && q();
1246
1246
  }
1247
- return de(() => _.isOpen, (h) => {
1248
- h ? (Ce(() => {
1247
+ return oe(() => _.isOpen, (h) => {
1248
+ h ? (ke(() => {
1249
1249
  var $;
1250
- ($ = f.value) == null || $.focus();
1251
- }), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", o.value = !1);
1252
- }), $e(() => {
1253
- document.addEventListener("keydown", n);
1254
- }), We(() => {
1255
- document.removeEventListener("keydown", n), document.body.style.overflow = "";
1256
- }), (h, $) => (a(), xe(jt, { to: "body" }, [
1257
- ze(Ee, { name: "artifactuse-viewer" }, {
1258
- default: Be(() => [
1259
- H.isOpen ? (a(), s("div", {
1250
+ ($ = p.value) == null || $.focus();
1251
+ }), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", r.value = !1);
1252
+ }), Te(() => {
1253
+ document.addEventListener("keydown", o);
1254
+ }), Ye(() => {
1255
+ document.removeEventListener("keydown", o), document.body.style.overflow = "";
1256
+ }), (h, $) => (a(), Me(aa, { to: "body" }, [
1257
+ Fe(ze, { name: "artifactuse-viewer" }, {
1258
+ default: Ve(() => [
1259
+ P.isOpen ? (a(), s("div", {
1260
1260
  key: 0,
1261
1261
  class: "artifactuse-viewer-overlay",
1262
1262
  onClick: q,
1263
- onKeydown: Nt(q, ["escape"]),
1263
+ onKeydown: sa(q, ["escape"]),
1264
1264
  tabindex: "-1",
1265
1265
  ref_key: "overlayRef",
1266
- ref: f
1266
+ ref: p
1267
1267
  }, [
1268
1268
  e("div", {
1269
1269
  class: "artifactuse-viewer-content",
1270
- onClick: $[0] || ($[0] = he(() => {
1270
+ onClick: $[0] || ($[0] = _e(() => {
1271
1271
  }, ["stop"]))
1272
1272
  }, [
1273
- H.type === "image" ? (a(), s("img", {
1273
+ P.type === "image" ? (a(), s("img", {
1274
1274
  key: 0,
1275
- src: H.src,
1276
- alt: H.alt,
1277
- class: N(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed": o.value }]),
1278
- onClick: E
1279
- }, null, 10, sl)) : H.type === "pdf" ? (a(), s("iframe", {
1275
+ src: P.src,
1276
+ alt: P.alt,
1277
+ class: I(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed": r.value }]),
1278
+ onClick: A
1279
+ }, null, 10, _i)) : P.type === "pdf" ? (a(), s("iframe", {
1280
1280
  key: 1,
1281
- src: H.src,
1281
+ src: P.src,
1282
1282
  class: "artifactuse-viewer-pdf"
1283
- }, null, 8, il)) : v("", !0),
1283
+ }, null, 8, hi)) : v("", !0),
1284
1284
  e("button", {
1285
1285
  class: "artifactuse-viewer-close",
1286
1286
  onClick: q,
@@ -1306,13 +1306,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
1306
1306
  })
1307
1307
  ], -1)
1308
1308
  ])]),
1309
- H.type === "image" ? (a(), s("div", ll, [
1309
+ P.type === "image" ? (a(), s("div", mi, [
1310
1310
  e("button", {
1311
1311
  class: "artifactuse-viewer-control",
1312
- onClick: he(E, ["stop"]),
1313
- title: o.value ? "Zoom out" : "Zoom in"
1312
+ onClick: _e(A, ["stop"]),
1313
+ title: r.value ? "Zoom out" : "Zoom in"
1314
1314
  }, [
1315
- o.value ? (a(), s("svg", rl, [...$[3] || ($[3] = [
1315
+ r.value ? (a(), s("svg", ki, [...$[3] || ($[3] = [
1316
1316
  e("circle", {
1317
1317
  cx: "11",
1318
1318
  cy: "11",
@@ -1330,7 +1330,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
1330
1330
  x2: "14",
1331
1331
  y2: "11"
1332
1332
  }, null, -1)
1333
- ])])) : (a(), s("svg", ol, [...$[2] || ($[2] = [
1333
+ ])])) : (a(), s("svg", gi, [...$[2] || ($[2] = [
1334
1334
  e("circle", {
1335
1335
  cx: "11",
1336
1336
  cy: "11",
@@ -1355,10 +1355,10 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
1355
1355
  y2: "11"
1356
1356
  }, null, -1)
1357
1357
  ])]))
1358
- ], 8, nl),
1358
+ ], 8, yi),
1359
1359
  e("button", {
1360
1360
  class: "artifactuse-viewer-control",
1361
- onClick: he(g, ["stop"]),
1361
+ onClick: _e(g, ["stop"]),
1362
1362
  title: "Download"
1363
1363
  }, [...$[4] || ($[4] = [
1364
1364
  e("svg", {
@@ -1378,7 +1378,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
1378
1378
  ], -1)
1379
1379
  ])])
1380
1380
  ])) : v("", !0),
1381
- H.caption ? (a(), s("div", cl, l(H.caption), 1)) : v("", !0)
1381
+ P.caption ? (a(), s("div", wi, n(P.caption), 1)) : v("", !0)
1382
1382
  ])
1383
1383
  ], 544)) : v("", !0)
1384
1384
  ]),
@@ -1386,7 +1386,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
1386
1386
  })
1387
1387
  ]));
1388
1388
  }
1389
- }, dl = ["innerHTML"], uo = {
1389
+ }, Ci = ["innerHTML"], Mo = {
1390
1390
  __name: "ArtifactuseAgentMessage",
1391
1391
  props: {
1392
1392
  // The raw message content (markdown/HTML from AI)
@@ -1447,211 +1447,211 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
1447
1447
  "social-copy",
1448
1448
  "media-open"
1449
1449
  ],
1450
- setup(H, { expose: c, emit: _ }) {
1451
- const M = H, f = _, {
1452
- processMessage: o,
1450
+ setup(P, { expose: c, emit: _ }) {
1451
+ const T = P, p = _, {
1452
+ processMessage: r,
1453
1453
  openArtifact: q,
1454
- state: E,
1454
+ state: A,
1455
1455
  getTheme: g,
1456
- instance: n
1457
- } = Ve(), h = T(null), $ = T(null), I = T(""), x = T([]);
1458
- let j = null;
1459
- const O = T(!1), W = T("image"), Y = T(""), S = T(""), ie = T(""), Z = C(() => (g == null ? void 0 : g()) || "dark"), X = C(() => E.activeArtifactId), oe = C(() => {
1460
- var b;
1461
- return M.inlineCards ?? ((b = n == null ? void 0 : n.config) == null ? void 0 : b.inlineCards) ?? !0;
1462
- }), m = T(!1);
1463
- $e(() => {
1464
- M.typing && (m.value = !0);
1465
- }), de(() => M.typing, (b) => {
1466
- b && (m.value = !0);
1456
+ instance: o
1457
+ } = Re(), h = M(null), $ = M(null), V = M(""), x = M([]);
1458
+ let D = null;
1459
+ const U = M(!1), N = M("image"), ee = M(""), B = M(""), re = M(""), K = b(() => (g == null ? void 0 : g()) || "dark"), Z = b(() => A.activeArtifactId), ve = b(() => {
1460
+ var C;
1461
+ return T.inlineCards ?? ((C = o == null ? void 0 : o.config) == null ? void 0 : C.inlineCards) ?? !0;
1462
+ }), m = M(!1);
1463
+ Te(() => {
1464
+ T.typing && (m.value = !0);
1465
+ }), oe(() => T.typing, (C) => {
1466
+ C && (m.value = !0);
1467
1467
  });
1468
- const k = C(() => m.value || M.isLastMessage ? "active" : "inactive");
1469
- function ee(b) {
1470
- if (!b) return null;
1468
+ const k = b(() => m.value || T.isLastMessage ? "active" : "inactive");
1469
+ function ae(C) {
1470
+ if (!C) return null;
1471
1471
  try {
1472
- const V = decodeURIComponent(escape(atob(b)));
1473
- return JSON.parse(V);
1472
+ const R = decodeURIComponent(escape(atob(C)));
1473
+ return JSON.parse(R);
1474
1474
  } catch {
1475
1475
  try {
1476
- const D = b.replace(/&#10;/g, `
1476
+ const O = C.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
- return JSON.parse(D);
1479
- } catch (D) {
1480
- return console.error("Failed to parse artifact data:", D), null;
1478
+ return JSON.parse(O);
1479
+ } catch (O) {
1480
+ return console.error("Failed to parse artifact data:", O), null;
1481
1481
  }
1482
1482
  }
1483
1483
  }
1484
- const re = C(() => {
1485
- const b = [], V = I.value;
1486
- if (!V) return b;
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(V)) !== null; ) {
1490
- if (A.index > te) {
1491
- const U = V.slice(te, A.index);
1492
- U.trim() && b.push({ type: "html", content: U });
1484
+ const Q = b(() => {
1485
+ const C = [], R = V.value;
1486
+ if (!R) return C;
1487
+ const O = /<div\s+class="artifactuse-placeholder[^"]*"[^>]*data-artifact-id="([^"]+)"[^>]*data-artifact-type="([^"]+)"[^>]*data-artifact=["']([^"']*)["'][^>]*><\/div>/gi;
1488
+ let J = 0, S;
1489
+ for (; (S = O.exec(R)) !== null; ) {
1490
+ if (S.index > J) {
1491
+ const j = R.slice(J, S.index);
1492
+ j.trim() && C.push({ type: "html", content: j });
1493
1493
  }
1494
- const ae = ee(A[3]), d = A[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 = A.index + A[0].length;
1494
+ const te = ae(S[3]), f = S[2];
1495
+ te && (f === "form" && te.isInline ? C.push({ type: "form", artifact: te }) : f === "social" ? C.push({ type: "social", artifact: te }) : C.push({ type: "panel", artifact: te })), J = S.index + S[0].length;
1496
1496
  }
1497
- if (te < V.length) {
1498
- const ae = V.slice(te);
1499
- ae.trim() && b.push({ type: "html", content: ae });
1497
+ if (J < R.length) {
1498
+ const te = R.slice(J);
1499
+ te.trim() && C.push({ type: "html", content: te });
1500
1500
  }
1501
- return b.length === 0 && V.trim() && b.push({ type: "html", content: V }), b;
1501
+ return C.length === 0 && R.trim() && C.push({ type: "html", content: R }), C;
1502
1502
  });
1503
- function P(b) {
1504
- W.value = b.type || "image", Y.value = b.src || "", S.value = b.alt || "", ie.value = b.caption || "", O.value = !0, f("media-open", b);
1503
+ function W(C) {
1504
+ N.value = C.type || "image", ee.value = C.src || "", B.value = C.alt || "", re.value = C.caption || "", U.value = !0, p("media-open", C);
1505
1505
  }
1506
- function Q() {
1507
- O.value = !1, Y.value = "", S.value = "", ie.value = "";
1506
+ function ie() {
1507
+ U.value = !1, ee.value = "", B.value = "", re.value = "";
1508
1508
  }
1509
1509
  function w() {
1510
1510
  if (!$.value) return;
1511
- $.value.querySelectorAll('img[data-lightbox="true"]').forEach((d) => {
1512
- d._lightboxHandler && d.removeEventListener("click", d._lightboxHandler), d._lightboxHandler = (U) => {
1513
- U.preventDefault(), U.stopPropagation(), P({
1511
+ $.value.querySelectorAll('img[data-lightbox="true"]').forEach((f) => {
1512
+ f._lightboxHandler && f.removeEventListener("click", f._lightboxHandler), f._lightboxHandler = (j) => {
1513
+ j.preventDefault(), j.stopPropagation(), W({
1514
1514
  type: "image",
1515
- src: d.src,
1516
- alt: d.alt || "",
1517
- caption: d.dataset.caption || d.alt || ""
1515
+ src: f.src,
1516
+ alt: f.alt || "",
1517
+ caption: f.dataset.caption || f.alt || ""
1518
1518
  });
1519
- }, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in";
1520
- }), $.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"), Me = (ce == null ? void 0 : ce.textContent) || d.dataset.caption || d.alt || "";
1524
- P({
1519
+ }, f.addEventListener("click", f._lightboxHandler), f.style.cursor = "zoom-in";
1520
+ }), $.value.querySelectorAll(".artifactuse-image-container img").forEach((f) => {
1521
+ f._lightboxHandler || (f._lightboxHandler = (j) => {
1522
+ j.preventDefault(), j.stopPropagation();
1523
+ const le = f.closest(".artifactuse-image-container"), G = le == null ? void 0 : le.querySelector(".artifactuse-image-caption"), me = (G == null ? void 0 : G.textContent) || f.dataset.caption || f.alt || "";
1524
+ W({
1525
1525
  type: "image",
1526
- src: d.src,
1527
- alt: d.alt || "",
1528
- caption: Me
1526
+ src: f.src,
1527
+ alt: f.alt || "",
1528
+ caption: me
1529
1529
  });
1530
- }, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in");
1531
- }), $.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"), Me = (ce == null ? void 0 : ce.textContent) || d.dataset.caption || d.alt || "";
1535
- P({
1530
+ }, f.addEventListener("click", f._lightboxHandler), f.style.cursor = "zoom-in");
1531
+ }), $.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((f) => {
1532
+ f._lightboxHandler || (f._lightboxHandler = (j) => {
1533
+ j.preventDefault(), j.stopPropagation();
1534
+ const le = f.closest(".artifactuse-gallery-item"), G = le == null ? void 0 : le.querySelector(".artifactuse-gallery-caption"), me = (G == null ? void 0 : G.textContent) || f.dataset.caption || f.alt || "";
1535
+ W({
1536
1536
  type: "image",
1537
- src: d.src,
1538
- alt: d.alt || "",
1539
- caption: Me
1537
+ src: f.src,
1538
+ alt: f.alt || "",
1539
+ caption: me
1540
1540
  });
1541
- }, d.addEventListener("click", d._lightboxHandler), d.style.cursor = "zoom-in");
1542
- }), $.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(), P({
1541
+ }, f.addEventListener("click", f._lightboxHandler), f.style.cursor = "zoom-in");
1542
+ }), $.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((f) => {
1543
+ f._pdfHandler && f.removeEventListener("click", f._pdfHandler), f._pdfHandler = (j) => {
1544
+ j.preventDefault(), j.stopPropagation(), W({
1545
1545
  type: "pdf",
1546
- src: d.href,
1547
- alt: d.textContent || "PDF Document",
1548
- caption: d.title || d.textContent || ""
1546
+ src: f.href,
1547
+ alt: f.textContent || "PDF Document",
1548
+ caption: f.title || f.textContent || ""
1549
1549
  });
1550
- }, d.addEventListener("click", d._pdfHandler);
1551
- }), $.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((d) => {
1552
- var G;
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(), P({
1550
+ }, f.addEventListener("click", f._pdfHandler);
1551
+ }), $.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((f) => {
1552
+ var le;
1553
+ f._pdfHandler && f.removeEventListener("click", f._pdfHandler);
1554
+ const j = f.dataset.pdfSrc || ((le = f.querySelector("iframe")) == null ? void 0 : le.src) || "";
1555
+ j && (f._pdfHandler = (G) => {
1556
+ G.preventDefault(), G.stopPropagation(), W({
1557
1557
  type: "pdf",
1558
- src: U,
1558
+ src: j,
1559
1559
  alt: "PDF Document",
1560
- caption: d.dataset.caption || ""
1560
+ caption: f.dataset.caption || ""
1561
1561
  });
1562
- }, d.addEventListener("click", d._pdfHandler), d.style.cursor = "pointer");
1563
- }), $.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
- G && window.open(G, "_blank", "noopener,noreferrer");
1568
- }, d.addEventListener("click", d._clickHandler);
1562
+ }, f.addEventListener("click", f._pdfHandler), f.style.cursor = "pointer");
1563
+ }), $.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((f) => {
1564
+ f._clickHandler && f.removeEventListener("click", f._clickHandler), f._clickHandler = (j) => {
1565
+ if (j.target.closest(".artifactuse-video-play-button")) return;
1566
+ const le = f.dataset.videoUrl || f.dataset.url;
1567
+ le && window.open(le, "_blank", "noopener,noreferrer");
1568
+ }, f.addEventListener("click", f._clickHandler);
1569
1569
  });
1570
1570
  }
1571
- function L() {
1571
+ function E() {
1572
1572
  if (!$.value) return;
1573
- $.value.querySelectorAll("img").forEach((A) => {
1574
- A._lightboxHandler && (A.removeEventListener("click", A._lightboxHandler), delete A._lightboxHandler);
1575
- }), $.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((A) => {
1576
- A._pdfHandler && (A.removeEventListener("click", A._pdfHandler), delete A._pdfHandler);
1577
- }), $.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((A) => {
1578
- A._pdfHandler && (A.removeEventListener("click", A._pdfHandler), delete A._pdfHandler);
1579
- }), $.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((A) => {
1580
- A._clickHandler && (A.removeEventListener("click", A._clickHandler), delete A._clickHandler);
1573
+ $.value.querySelectorAll("img").forEach((S) => {
1574
+ S._lightboxHandler && (S.removeEventListener("click", S._lightboxHandler), delete S._lightboxHandler);
1575
+ }), $.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((S) => {
1576
+ S._pdfHandler && (S.removeEventListener("click", S._pdfHandler), delete S._pdfHandler);
1577
+ }), $.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((S) => {
1578
+ S._pdfHandler && (S.removeEventListener("click", S._pdfHandler), delete S._pdfHandler);
1579
+ }), $.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((S) => {
1580
+ S._clickHandler && (S.removeEventListener("click", S._clickHandler), delete S._clickHandler);
1581
1581
  });
1582
1582
  }
1583
- function r() {
1584
- j && clearTimeout(j), j = setTimeout(async () => {
1585
- if (await Ce(), n != null && n.initializeContent && $.value)
1583
+ function i() {
1584
+ D && clearTimeout(D), D = setTimeout(async () => {
1585
+ if (await ke(), o != null && o.initializeContent && $.value)
1586
1586
  try {
1587
- await n.initializeContent($.value);
1588
- } catch (b) {
1589
- console.error("Failed to initialize content:", b);
1587
+ await o.initializeContent($.value);
1588
+ } catch (C) {
1589
+ console.error("Failed to initialize content:", C);
1590
1590
  }
1591
1591
  w();
1592
1592
  }, 100);
1593
1593
  }
1594
- de(
1595
- () => M.content,
1596
- (b) => {
1597
- if (b) {
1598
- const V = o(b, M.messageId, {
1599
- inlinePreview: M.inlinePreview,
1600
- inlineCode: M.inlineCode,
1601
- tabs: M.tabs,
1602
- viewMode: M.viewMode
1594
+ oe(
1595
+ () => T.content,
1596
+ (C) => {
1597
+ if (C) {
1598
+ const R = r(C, T.messageId, {
1599
+ inlinePreview: T.inlinePreview,
1600
+ inlineCode: T.inlineCode,
1601
+ tabs: T.tabs,
1602
+ viewMode: T.viewMode
1603
1603
  });
1604
- I.value = V.html, x.value = V.artifacts, V.artifacts.length > 0 && f("artifact-detected", V.artifacts), M.typing || r();
1604
+ V.value = R.html, x.value = R.artifacts, R.artifacts.length > 0 && p("artifact-detected", R.artifacts), T.typing || i();
1605
1605
  }
1606
1606
  },
1607
1607
  { immediate: !0 }
1608
- ), de(
1609
- () => M.typing,
1610
- (b, V) => {
1611
- V === !0 && b === !1 && r();
1608
+ ), oe(
1609
+ () => T.typing,
1610
+ (C, R) => {
1611
+ R === !0 && C === !1 && i();
1612
1612
  }
1613
- ), $e(() => {
1614
- M.typing || r();
1615
- }), Wt(() => {
1616
- j && clearTimeout(j), L();
1613
+ ), Te(() => {
1614
+ T.typing || i();
1615
+ }), la(() => {
1616
+ D && clearTimeout(D), E();
1617
1617
  });
1618
- function B(b) {
1619
- const V = b.target.closest(".artifactuse-inline-preview");
1620
- if (V) {
1621
- if (V.dataset.nonClickable) return;
1622
- const D = V.dataset.artifactId;
1623
- if (D) {
1624
- const te = E.artifacts.find((A) => A.id === D);
1625
- te && u(te);
1618
+ function H(C) {
1619
+ const R = C.target.closest(".artifactuse-inline-preview");
1620
+ if (R) {
1621
+ if (R.dataset.nonClickable) return;
1622
+ const O = R.dataset.artifactId;
1623
+ if (O) {
1624
+ const J = A.artifacts.find((S) => S.id === O);
1625
+ J && d(J);
1626
1626
  }
1627
1627
  }
1628
1628
  }
1629
- function u(b) {
1630
- q(b), f("artifact-open", b);
1629
+ function d(C) {
1630
+ q(C), p("artifact-open", C);
1631
1631
  }
1632
- function z(b) {
1633
- f("artifact-copy", b);
1632
+ function L(C) {
1633
+ p("artifact-copy", C);
1634
1634
  }
1635
- function le(b) {
1636
- f("artifact-download", b);
1635
+ function se(C) {
1636
+ p("artifact-download", C);
1637
1637
  }
1638
- function pe(b) {
1639
- f("form-submit", b);
1638
+ function ce(C) {
1639
+ p("form-submit", C);
1640
1640
  }
1641
- function ye(b) {
1642
- f("form-cancel", b);
1641
+ function we(C) {
1642
+ p("form-cancel", C);
1643
1643
  }
1644
- function fe(b) {
1645
- f("form-button-click", b);
1644
+ function be(C) {
1645
+ p("form-button-click", C);
1646
1646
  }
1647
- function Pe(b) {
1648
- f("social-copy", b);
1647
+ function Le(C) {
1648
+ p("social-copy", C);
1649
1649
  }
1650
- return C(() => E.artifacts.filter((b) => b.messageId === M.messageId)), c({
1651
- openViewer: P,
1652
- closeViewer: Q,
1650
+ return b(() => A.artifacts.filter((C) => C.messageId === T.messageId)), c({
1651
+ openViewer: W,
1652
+ closeViewer: ie,
1653
1653
  attachMediaListeners: w
1654
- }), (b, V) => (a(), s("div", {
1654
+ }), (C, R) => (a(), s("div", {
1655
1655
  class: "artifactuse-agent-message",
1656
1656
  ref_key: "messageRef",
1657
1657
  ref: h
@@ -1660,566 +1660,586 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
1660
1660
  class: "artifactuse-message-content",
1661
1661
  ref_key: "contentRef",
1662
1662
  ref: $,
1663
- onClick: B
1663
+ onClick: H
1664
1664
  }, [
1665
- (a(!0), s(R, null, ve(re.value, (D, te) => (a(), s(R, { key: te }, [
1666
- D.type === "html" ? (a(), s("div", {
1665
+ (a(!0), s(F, null, de(Q.value, (O, J) => (a(), s(F, { key: J }, [
1666
+ O.type === "html" ? (a(), s("div", {
1667
1667
  key: 0,
1668
- innerHTML: D.content
1669
- }, null, 8, dl)) : D.type === "form" && D.artifact.isInline ? (a(), xe(Ga, {
1668
+ innerHTML: O.content
1669
+ }, null, 8, Ci)) : O.type === "form" && O.artifact.isInline ? (a(), Me(ds, {
1670
1670
  key: 1,
1671
- artifact: D.artifact,
1672
- theme: Z.value,
1671
+ artifact: O.artifact,
1672
+ theme: K.value,
1673
1673
  "initial-state": k.value,
1674
- onSubmit: pe,
1675
- onCancel: ye,
1676
- onButtonClick: fe
1677
- }, null, 8, ["artifact", "theme", "initial-state"])) : D.type === "social" ? (a(), xe(al, {
1674
+ onSubmit: ce,
1675
+ onCancel: we,
1676
+ onButtonClick: be
1677
+ }, null, 8, ["artifact", "theme", "initial-state"])) : O.type === "social" ? (a(), Me(pi, {
1678
1678
  key: 2,
1679
- artifact: D.artifact,
1680
- theme: Z.value,
1681
- onCopy: Pe
1682
- }, null, 8, ["artifact", "theme"])) : D.type === "panel" && oe.value ? (a(), xe(ua, {
1679
+ artifact: O.artifact,
1680
+ theme: K.value,
1681
+ onCopy: Le
1682
+ }, null, 8, ["artifact", "theme"])) : O.type === "panel" && ve.value ? (a(), Me(ba, {
1683
1683
  key: 3,
1684
- artifact: D.artifact,
1685
- "is-active": X.value === D.artifact.id,
1686
- onOpen: u,
1687
- onCopy: z,
1688
- onDownload: le
1684
+ artifact: O.artifact,
1685
+ "is-active": Z.value === O.artifact.id,
1686
+ onOpen: d,
1687
+ onCopy: L,
1688
+ onDownload: se
1689
1689
  }, null, 8, ["artifact", "is-active"])) : v("", !0)
1690
1690
  ], 64))), 128))
1691
1691
  ], 512),
1692
- ze(ul, {
1693
- "is-open": O.value,
1694
- type: W.value,
1695
- src: Y.value,
1696
- alt: S.value,
1697
- caption: ie.value,
1698
- onClose: Q
1692
+ Fe(bi, {
1693
+ "is-open": U.value,
1694
+ type: N.value,
1695
+ src: ee.value,
1696
+ alt: B.value,
1697
+ caption: re.value,
1698
+ onClose: ie
1699
1699
  }, null, 8, ["is-open", "type", "src", "alt", "caption"])
1700
1700
  ], 512));
1701
1701
  }
1702
- }, vl = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, fl = { class: "artifactuse-panel__title" }, pl = { class: "artifactuse-panel__icon" }, _l = {
1702
+ }, xi = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, $i = { class: "artifactuse-panel__title" }, Mi = { class: "artifactuse-panel__icon" }, Ti = {
1703
1703
  key: 0,
1704
1704
  viewBox: "0 0 24 24",
1705
1705
  fill: "none",
1706
1706
  stroke: "currentColor",
1707
1707
  "stroke-width": "2"
1708
- }, hl = {
1708
+ }, Li = {
1709
1709
  key: 1,
1710
1710
  viewBox: "0 0 24 24",
1711
1711
  fill: "none",
1712
1712
  stroke: "currentColor",
1713
1713
  "stroke-width": "2"
1714
- }, ml = { class: "artifactuse-panel__title-content" }, yl = { class: "artifactuse-panel__name" }, gl = { class: "artifactuse-panel__actions" }, kl = { class: "artifactuse-panel__empty" }, wl = { class: "artifactuse-panel__empty-title" }, bl = { class: "artifactuse-panel__empty-text" }, Cl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, xl = {
1714
+ }, Pi = { class: "artifactuse-panel__title-content" }, Ei = { class: "artifactuse-panel__name" }, Ai = { class: "artifactuse-panel__actions" }, Hi = { class: "artifactuse-panel__empty" }, Bi = { class: "artifactuse-panel__empty-title" }, Si = { class: "artifactuse-panel__empty-text" }, zi = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, Vi = {
1715
1715
  key: 0,
1716
1716
  href: "https://artifactuse.com",
1717
1717
  target: "_blank",
1718
1718
  rel: "noopener noreferrer",
1719
1719
  class: "artifactuse-panel__branding"
1720
- }, $l = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, Ml = { class: "artifactuse-panel__title" }, Tl = { class: "artifactuse-panel__title-content" }, Ll = { class: "artifactuse-panel__meta" }, Pl = { class: "artifactuse-panel__actions" }, Al = ["disabled"], Hl = {
1720
+ }, Ii = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, Fi = { class: "artifactuse-panel__title" }, Ri = { class: "artifactuse-panel__title-content" }, qi = { class: "artifactuse-panel__meta" }, Oi = { class: "artifactuse-panel__actions" }, Ui = ["disabled"], Di = {
1721
1721
  key: 0,
1722
1722
  viewBox: "0 0 24 24",
1723
1723
  fill: "none",
1724
1724
  stroke: "currentColor",
1725
1725
  "stroke-width": "2"
1726
- }, El = {
1726
+ }, ji = {
1727
1727
  key: 1,
1728
1728
  class: "artifactuse-panel__spinner-icon",
1729
1729
  viewBox: "0 0 24 24",
1730
1730
  fill: "none",
1731
1731
  stroke: "currentColor",
1732
1732
  "stroke-width": "2"
1733
- }, Bl = { class: "artifactuse-panel__list" }, Sl = { class: "artifactuse-panel__list-items" }, zl = ["onClick"], Vl = ["innerHTML"], Il = { class: "artifactuse-panel__list-item-content" }, Fl = { class: "artifactuse-panel__list-item-title" }, Rl = { class: "artifactuse-panel__list-item-meta" }, ql = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, Ol = {
1733
+ }, Ni = { class: "artifactuse-panel__list" }, Wi = { class: "artifactuse-panel__list-items" }, Ji = ["onClick"], Xi = ["innerHTML"], Zi = { class: "artifactuse-panel__list-item-content" }, Ki = { class: "artifactuse-panel__list-item-title" }, Yi = { class: "artifactuse-panel__list-item-meta" }, Qi = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, Gi = {
1734
1734
  key: 0,
1735
1735
  href: "https://artifactuse.com",
1736
1736
  target: "_blank",
1737
1737
  rel: "noopener noreferrer",
1738
1738
  class: "artifactuse-panel__branding"
1739
- }, Ul = { class: "artifactuse-panel__header" }, Dl = ["title"], jl = { class: "artifactuse-panel__title" }, Nl = ["innerHTML"], Wl = { class: "artifactuse-panel__title-content" }, Jl = { class: "artifactuse-panel__name" }, Xl = { class: "artifactuse-panel__meta" }, Zl = { class: "artifactuse-panel__tabs" }, Kl = ["disabled"], Yl = ["disabled"], Ql = { class: "artifactuse-panel__actions" }, Gl = ["title"], en = {
1739
+ }, en = { class: "artifactuse-panel__header" }, tn = ["title"], an = { class: "artifactuse-panel__title" }, sn = ["innerHTML"], ln = { class: "artifactuse-panel__title-content" }, nn = { class: "artifactuse-panel__name" }, on = { class: "artifactuse-panel__meta" }, rn = { class: "artifactuse-panel__tabs" }, cn = ["disabled"], un = ["disabled"], dn = { class: "artifactuse-panel__actions" }, vn = ["title"], fn = {
1740
1740
  key: 0,
1741
1741
  viewBox: "0 0 24 24",
1742
1742
  fill: "none",
1743
1743
  stroke: "currentColor",
1744
1744
  "stroke-width": "2"
1745
- }, tn = {
1745
+ }, pn = {
1746
1746
  key: 1,
1747
1747
  viewBox: "0 0 24 24",
1748
1748
  fill: "none",
1749
1749
  stroke: "currentColor",
1750
1750
  "stroke-width": "2"
1751
- }, an = {
1751
+ }, _n = {
1752
1752
  key: 0,
1753
1753
  class: "artifactuse-panel__file-tabs"
1754
- }, sn = { class: "artifactuse-panel__file-tabs-scroll" }, ln = ["onClick"], nn = ["innerHTML"], on = { class: "artifactuse-panel__file-tab-title" }, rn = ["onClick"], cn = {
1754
+ }, hn = { class: "artifactuse-panel__file-tabs-scroll" }, mn = ["onClick"], yn = ["innerHTML"], gn = { class: "artifactuse-panel__file-tab-title" }, kn = ["onClick"], wn = {
1755
1755
  key: 0,
1756
1756
  class: "artifactuse-panel__loading"
1757
- }, un = {
1757
+ }, bn = {
1758
1758
  key: 0,
1759
1759
  class: "artifactuse-panel__loading"
1760
- }, dn = ["src"], vn = {
1760
+ }, Cn = ["src"], xn = {
1761
1761
  key: 2,
1762
1762
  class: "artifactuse-panel__no-preview"
1763
- }, fn = { class: "artifactuse-panel__edit" }, pn = { class: "artifactuse-panel__footer" }, _n = { class: "artifactuse-panel__footer-left" }, hn = {
1763
+ }, $n = { class: "artifactuse-panel__edit" }, Mn = { class: "artifactuse-panel__console-type" }, Tn = { class: "artifactuse-panel__console-content" }, Ln = { class: "artifactuse-panel__console-timestamp" }, Pn = { class: "artifactuse-panel__footer" }, En = { class: "artifactuse-panel__footer-left" }, An = {
1764
1764
  key: 0,
1765
1765
  href: "https://artifactuse.com",
1766
1766
  target: "_blank",
1767
1767
  rel: "noopener noreferrer",
1768
1768
  class: "artifactuse-panel__branding"
1769
- }, mn = {
1769
+ }, Hn = {
1770
1770
  key: 1,
1771
1771
  class: "artifactuse-panel__badge"
1772
- }, yn = { class: "artifactuse-panel__footer-right" }, gn = ["title"], kn = {
1772
+ }, Bn = { class: "artifactuse-panel__footer-right" }, Sn = ["title"], zn = {
1773
1773
  key: 0,
1774
1774
  viewBox: "0 0 24 24",
1775
1775
  fill: "none",
1776
1776
  stroke: "currentColor",
1777
1777
  "stroke-width": "2"
1778
- }, wn = {
1778
+ }, Vn = {
1779
1779
  key: 1,
1780
1780
  viewBox: "0 0 24 24",
1781
1781
  fill: "none",
1782
1782
  stroke: "currentColor",
1783
1783
  "stroke-width": "2"
1784
- }, bn = {
1784
+ }, In = {
1785
1785
  key: 0,
1786
1786
  style: { position: "relative" }
1787
- }, Cn = {
1787
+ }, Fn = {
1788
1788
  key: 0,
1789
1789
  class: "artifactuse-share-popup"
1790
- }, xn = { class: "artifactuse-share-popup__header" }, $n = { class: "artifactuse-share-popup__title" }, Mn = { class: "artifactuse-share-popup__body" }, Tn = {
1790
+ }, Rn = { class: "artifactuse-share-popup__header" }, qn = { class: "artifactuse-share-popup__title" }, On = { class: "artifactuse-share-popup__body" }, Un = {
1791
1791
  key: 0,
1792
1792
  class: "artifactuse-share-popup__loading"
1793
- }, Ln = { key: 1 }, Pn = { class: "artifactuse-share-popup__error" }, An = { class: "artifactuse-share-popup__error-text" }, Hn = { class: "artifactuse-share-popup__actions" }, En = {
1793
+ }, Dn = { key: 1 }, jn = { class: "artifactuse-share-popup__error" }, Nn = { class: "artifactuse-share-popup__error-text" }, Wn = { class: "artifactuse-share-popup__actions" }, Jn = {
1794
1794
  key: 2,
1795
1795
  class: "artifactuse-share-popup__options"
1796
- }, Bn = { key: 3 }, Sn = {
1796
+ }, Xn = { key: 3 }, Zn = {
1797
1797
  key: 0,
1798
1798
  class: "artifactuse-share-popup__loading"
1799
- }, zn = {
1799
+ }, Kn = {
1800
1800
  key: 1,
1801
1801
  class: "artifactuse-share-popup__empty"
1802
- }, Vn = {
1802
+ }, Yn = {
1803
1803
  key: 2,
1804
1804
  class: "artifactuse-share-popup__artifact-list"
1805
- }, In = ["onClick"], Fn = { class: "artifactuse-share-popup__artifact-name" }, Rn = { class: "artifactuse-share-popup__artifact-date" }, qn = {
1805
+ }, Qn = ["onClick"], Gn = { class: "artifactuse-share-popup__artifact-name" }, eo = { class: "artifactuse-share-popup__artifact-date" }, to = {
1806
1806
  key: 4,
1807
1807
  class: "artifactuse-share-popup__success"
1808
- }, On = { class: "artifactuse-share-popup__link-wrapper" }, Un = ["value"], Dn = {
1808
+ }, ao = { class: "artifactuse-share-popup__link-wrapper" }, so = ["value"], lo = {
1809
1809
  key: 0,
1810
1810
  class: "artifactuse-share-popup__expiry"
1811
- }, jn = { class: "artifactuse-share-popup__expiry-text" }, Nn = {
1811
+ }, io = { class: "artifactuse-share-popup__expiry-text" }, no = {
1812
1812
  key: 1,
1813
1813
  class: "artifactuse-share-popup__save-prompt"
1814
- }, Wn = {
1814
+ }, oo = {
1815
1815
  key: 2,
1816
1816
  class: "artifactuse-panel__nav"
1817
- }, Jn = ["disabled"], Xn = ["disabled"], Zn = {
1817
+ }, ro = ["disabled"], co = ["disabled"], uo = {
1818
1818
  key: 0,
1819
1819
  class: "artifactuse-panel__artifact-list"
1820
- }, Kn = { class: "artifactuse-panel__artifact-list-header" }, Yn = { class: "artifactuse-panel__artifact-list-items" }, Qn = ["onClick"], Gn = ["innerHTML"], eo = { class: "artifactuse-panel__artifact-item-content" }, to = { class: "artifactuse-panel__artifact-item-title" }, ao = { class: "artifactuse-panel__artifact-item-meta" }, so = { class: "artifactuse-panel__artifact-item-index" }, vo = {
1820
+ }, vo = { class: "artifactuse-panel__artifact-list-header" }, fo = { class: "artifactuse-panel__artifact-list-items" }, po = ["onClick"], _o = ["innerHTML"], ho = { class: "artifactuse-panel__artifact-item-content" }, mo = { class: "artifactuse-panel__artifact-item-title" }, yo = { class: "artifactuse-panel__artifact-item-meta" }, go = { class: "artifactuse-panel__artifact-item-index" }, To = {
1821
1821
  __name: "ArtifactusePanel",
1822
1822
  props: {
1823
1823
  panelWidth: { type: Number, default: void 0 },
1824
1824
  splitPosition: { type: Number, default: void 0 },
1825
- externalPreview: { type: Boolean, default: void 0 }
1825
+ externalPreview: { type: Boolean, default: void 0 },
1826
+ consolePanel: { type: Boolean, default: void 0 }
1826
1827
  },
1827
1828
  emits: ["close", "ai-request", "save", "export", "resize"],
1828
- setup(H, { emit: c }) {
1829
- var lt, nt;
1830
- const _ = c, M = H, {
1831
- state: f,
1832
- activeArtifact: o,
1829
+ setup(P, { emit: c }) {
1830
+ var ft, pt;
1831
+ const _ = c, T = P, {
1832
+ state: p,
1833
+ activeArtifact: r,
1833
1834
  artifactCount: q,
1834
- hasArtifacts: E,
1835
+ hasArtifacts: A,
1835
1836
  closePanel: g,
1836
- toggleFullscreen: n,
1837
+ toggleFullscreen: o,
1837
1838
  setViewMode: h,
1838
1839
  getPanelUrl: $,
1839
- openArtifact: I,
1840
+ openArtifact: V,
1840
1841
  instance: x
1841
- } = Ve(), j = T(null), O = T(null), W = T(null), Y = T(null), S = T(null), ie = T(null), Z = T(!1), X = T(!1), oe = T(!0), m = T(!1), k = T(!1), ee = T(!1), re = T(!1), P = T("options"), Q = T(""), w = T(null), L = T(""), r = T(!1), B = T(!1), u = T([]), z = T(!1), le = T("");
1842
- let pe = null, ye = null, fe = null;
1843
- const Pe = C(() => {
1844
- var i;
1845
- return ((i = x.editor) == null ? void 0 : i.isAvailable()) || !1;
1846
- }), b = T(
1847
- Math.min(Math.max(M.panelWidth ?? ((lt = x.config) == null ? void 0 : lt.panelWidth) ?? 65, 25), 75)
1848
- ), V = T(
1849
- Math.min(Math.max(M.splitPosition ?? ((nt = x.config) == null ? void 0 : nt.splitPosition) ?? 50, 20), 80)
1850
- ), D = C(() => o.value ? Se(o.value.language) : ""), te = C(() => o.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${je(o.value.language)}</svg>` : ""), A = C(() => {
1851
- if (!o.value) return null;
1852
- let i = $(o.value);
1853
- return i && o.value._refreshToken && (i += (i.includes("?") ? "&" : "?") + "_t=" + o.value._refreshToken), i;
1842
+ } = Re(), D = M(null), U = M(null), N = M(null), ee = M(null), B = M(null), re = M(null), K = M(!1), Z = M(!1), ve = M(!0), m = M(!1), k = M(!1), ae = M(!1), Q = M([]), W = M(!1), ie = M(null), w = M(/* @__PURE__ */ new Set(["log", "warn", "error", "info"])), E = M(!1), i = M("options"), H = M(""), d = M(null), L = M(""), se = M(!1), ce = M(!1), we = M([]), be = M(!1), Le = M("");
1843
+ let C = null, R = null, O = null, J = null;
1844
+ const S = b(() => {
1845
+ var l;
1846
+ return ((l = x.editor) == null ? void 0 : l.isAvailable()) || !1;
1847
+ }), te = M(
1848
+ Math.min(Math.max(T.panelWidth ?? ((ft = x.config) == null ? void 0 : ft.panelWidth) ?? 65, 25), 75)
1849
+ ), f = M(
1850
+ Math.min(Math.max(T.splitPosition ?? ((pt = x.config) == null ? void 0 : pt.splitPosition) ?? 50, 20), 80)
1851
+ ), j = b(() => r.value ? Ie(r.value.language) : ""), le = b(() => r.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${Ze(r.value.language)}</svg>` : ""), G = b(() => {
1852
+ if (!r.value) return null;
1853
+ let l = $(r.value);
1854
+ return l && r.value._refreshToken && (l += (l.includes("?") ? "&" : "?") + "_t=" + r.value._refreshToken), l;
1854
1855
  });
1855
- C(() => !o.value || !f.artifacts.length ? -1 : f.artifacts.findIndex((i) => i.id === o.value.id));
1856
- const ae = C(() => o.value ? Zt(o.value.language || "plaintext") : "plaintext"), d = C(() => f.artifacts.filter((i) => !i.isInline)), U = C(() => o.value ? d.value.findIndex((i) => i.id === o.value.id) : -1), G = C(() => {
1857
- var i;
1858
- return ((i = x.config) == null ? void 0 : i.branding) !== !1;
1859
- }), ce = C(() => {
1860
- var i, t;
1861
- return A.value ? ((i = o.value) == null ? void 0 : i.externalPreview) !== void 0 ? o.value.externalPreview : M.externalPreview !== void 0 ? M.externalPreview : ((t = x.config) == null ? void 0 : t.externalPreview) ?? !1 : !1;
1862
- }), Me = C(() => {
1863
- var i;
1864
- return ((i = x.share) == null ? void 0 : i.enabled) !== !1;
1865
- }), Je = C(() => {
1866
- var i;
1867
- return ((i = x.share) == null ? void 0 : i.isAuthenticated()) || !1;
1868
- }), _t = C(() => !o.value && !f.forceEmptyView ? Math.min(b.value, 30) : b.value), Te = C(() => {
1869
- var i;
1870
- return ((i = x.config) == null ? void 0 : i.multiTab) === !0;
1871
- }), ke = C(() => f.forceEmptyView), Xe = C(() => Te.value ? f.openTabs.map((i) => f.artifacts.find((t) => t.id === i)).filter(Boolean) : []);
1872
- function Ie(i) {
1873
- return `<svg viewBox="0 0 24 24" fill="currentColor">${je(i)}</svg>`;
1874
- }
1875
- function ht(i) {
1876
- I(i);
1856
+ b(() => !r.value || !p.artifacts.length ? -1 : p.artifacts.findIndex((l) => l.id === r.value.id));
1857
+ const me = b(() => r.value ? oa(r.value.language || "plaintext") : "plaintext"), fe = b(() => p.artifacts.filter((l) => !l.isInline)), Pe = b(() => r.value ? fe.value.findIndex((l) => l.id === r.value.id) : -1), qe = b(() => {
1858
+ var l;
1859
+ return ((l = x.config) == null ? void 0 : l.branding) !== !1;
1860
+ }), Ct = b(() => {
1861
+ var l, t;
1862
+ return G.value ? ((l = r.value) == null ? void 0 : l.externalPreview) !== void 0 ? r.value.externalPreview : T.externalPreview !== void 0 ? T.externalPreview : ((t = x.config) == null ? void 0 : t.externalPreview) ?? !1 : !1;
1863
+ }), Oe = b(() => Q.value.filter((l) => l.type === "error").length), Qe = b(() => Q.value.filter((l) => l.type === "warn").length), Ge = b(() => Q.value.filter((l) => l.type === "info").length), et = b(() => Q.value.filter((l) => l.type === "log").length), xt = b(() => Q.value.filter((l) => w.value.has(l.type)));
1864
+ function He(l) {
1865
+ const t = new Set(w.value);
1866
+ t.has(l) ? t.delete(l) : t.add(l), w.value = t;
1867
+ }
1868
+ const $t = b(() => {
1869
+ var l;
1870
+ return (T.consolePanel ?? ((l = x == null ? void 0 : x.config) == null ? void 0 : l.consolePanel)) !== !1 && Q.value.length > 0;
1871
+ }), Mt = b(() => {
1872
+ var l;
1873
+ return ((l = x.share) == null ? void 0 : l.enabled) !== !1;
1874
+ }), tt = b(() => {
1875
+ var l;
1876
+ return ((l = x.share) == null ? void 0 : l.isAuthenticated()) || !1;
1877
+ }), Tt = b(() => !r.value && !p.forceEmptyView ? Math.min(te.value, 30) : te.value), Ee = b(() => {
1878
+ var l;
1879
+ return ((l = x.config) == null ? void 0 : l.multiTab) === !0;
1880
+ }), Ce = b(() => p.forceEmptyView), at = b(() => Ee.value ? p.openTabs.map((l) => p.artifacts.find((t) => t.id === l)).filter(Boolean) : []);
1881
+ function Ue(l) {
1882
+ return `<svg viewBox="0 0 24 24" fill="currentColor">${Ze(l)}</svg>`;
1883
+ }
1884
+ function Lt(l) {
1885
+ V(l);
1886
+ }
1887
+ function Pt(l) {
1888
+ x.closeTab(l), p.openTabs.length === 0 && (k.value = !1);
1877
1889
  }
1878
- function mt(i) {
1879
- x.closeTab(i), f.openTabs.length === 0 && (k.value = !1);
1880
- }
1881
- function yt() {
1890
+ function Et() {
1882
1891
  k.value = !1, x.state.clearActiveArtifact();
1883
1892
  }
1884
- function Ze(i) {
1885
- if (i.language !== "smartdiff") return null;
1893
+ function st(l) {
1894
+ if (l.language !== "smartdiff") return null;
1886
1895
  try {
1887
- const t = JSON.parse(i.code);
1896
+ const t = JSON.parse(l.code);
1888
1897
  if (t.oldCode === void 0 || t.newCode === void 0) return null;
1889
- const p = t.language || "plaintext", F = ct() && window.Prism.languages[p], J = Kt(t.oldCode, t.newCode).split(`
1898
+ const u = t.language || "plaintext", z = mt() && window.Prism.languages[u], X = ra(t.oldCode, t.newCode).split(`
1890
1899
  `);
1891
- return { html: J.map((ue) => {
1892
- const ne = ue[0], be = ue.slice(1), ge = F ? window.Prism.highlight(be, F, p) : be;
1893
- return ne === "-" ? `<span class="token deleted">${ge}</span>` : ne === "+" ? `<span class="token inserted">${ge}</span>` : ge;
1900
+ return { html: X.map((pe) => {
1901
+ const ue = pe[0], $e = pe.slice(1), ge = z ? window.Prism.highlight($e, z, u) : $e;
1902
+ return ue === "-" ? `<span class="token deleted">${ge}</span>` : ue === "+" ? `<span class="token inserted">${ge}</span>` : ge;
1894
1903
  }).join(`
1895
- `), lineCount: J.length };
1904
+ `), lineCount: X.length };
1896
1905
  } catch {
1897
1906
  return null;
1898
1907
  }
1899
1908
  }
1900
- function gt() {
1901
- var i;
1902
- if (Y.value && ((i = o.value) != null && i.code)) {
1903
- const t = Ze(o.value), p = t ? t.lineCount : o.value.code.split(`
1909
+ function At() {
1910
+ var l;
1911
+ if (ee.value && ((l = r.value) != null && l.code)) {
1912
+ const t = st(r.value), u = t ? t.lineCount : r.value.code.split(`
1904
1913
  `).length;
1905
- Y.value.innerHTML = Array.from({ length: p }, (F, J) => `<div>${J + 1}</div>`).join("");
1914
+ ee.value.innerHTML = Array.from({ length: u }, (z, X) => `<div>${X + 1}</div>`).join("");
1906
1915
  }
1907
1916
  }
1908
- function kt() {
1909
- var i;
1910
- if (O.value && ct() && ((i = o.value) != null && i.code)) {
1911
- const t = Ze(o.value);
1917
+ function Ht() {
1918
+ var l;
1919
+ if (U.value && mt() && ((l = r.value) != null && l.code)) {
1920
+ const t = st(r.value);
1912
1921
  if (t)
1913
- O.value.innerHTML = t.html;
1922
+ U.value.innerHTML = t.html;
1914
1923
  else {
1915
- const p = window.Prism.languages[ae.value];
1916
- p ? O.value.innerHTML = window.Prism.highlight(
1917
- o.value.code,
1918
- p,
1919
- ae.value
1920
- ) : O.value.textContent = o.value.code;
1924
+ const u = window.Prism.languages[me.value];
1925
+ u ? U.value.innerHTML = window.Prism.highlight(
1926
+ r.value.code,
1927
+ u,
1928
+ me.value
1929
+ ) : U.value.textContent = r.value.code;
1921
1930
  }
1922
- O.value.dataset.highlighted = "true", Ce(() => {
1923
- wt();
1931
+ U.value.dataset.highlighted = "true", ke(() => {
1932
+ Bt();
1924
1933
  });
1925
1934
  }
1926
1935
  }
1927
- function wt() {
1936
+ function Bt() {
1928
1937
  var t;
1929
- const i = (t = O.value) == null ? void 0 : t.closest("pre");
1930
- if (i && S.value && Y.value) {
1931
- const F = window.getComputedStyle(i).backgroundColor;
1932
- F && F !== "rgba(0, 0, 0, 0)" && F !== "transparent" && (S.value.style.backgroundColor = F, Y.value.style.backgroundColor = F);
1938
+ const l = (t = U.value) == null ? void 0 : t.closest("pre");
1939
+ if (l && B.value && ee.value) {
1940
+ const z = window.getComputedStyle(l).backgroundColor;
1941
+ z && z !== "rgba(0, 0, 0, 0)" && z !== "transparent" && (B.value.style.backgroundColor = z, ee.value.style.backgroundColor = z);
1933
1942
  }
1934
1943
  }
1935
- function bt() {
1936
- S.value && (S.value.style.backgroundColor = ""), Y.value && (Y.value.style.backgroundColor = "");
1944
+ function St() {
1945
+ B.value && (B.value.style.backgroundColor = ""), ee.value && (ee.value.style.backgroundColor = "");
1937
1946
  }
1938
- function Ae() {
1939
- Ce(() => {
1940
- gt(), kt();
1947
+ function Be() {
1948
+ ke(() => {
1949
+ At(), Ht();
1941
1950
  });
1942
1951
  }
1943
- function Ke() {
1944
- !Pe.value || !ie.value || !o.value || (Fe(), fe = x.editor.create(ie.value, {
1945
- code: o.value.code || "",
1946
- language: o.value.editorLanguage || o.value.language || "plaintext",
1952
+ function lt() {
1953
+ !S.value || !re.value || !r.value || (De(), J = x.editor.create(re.value, {
1954
+ code: r.value.code || "",
1955
+ language: r.value.editorLanguage || r.value.language || "plaintext",
1947
1956
  sdkTheme: x.getTheme()
1948
1957
  }));
1949
1958
  }
1950
- function Fe() {
1951
- fe && (fe.destroy(), fe = null);
1959
+ function De() {
1960
+ J && (J.destroy(), J = null);
1952
1961
  }
1953
- function Ct() {
1954
- if (!fe || !o.value) return;
1955
- const i = fe.getCode();
1962
+ function zt() {
1963
+ if (!J || !r.value) return;
1964
+ const l = J.getCode();
1956
1965
  x.emit("edit:save", {
1957
- artifactId: o.value.id,
1958
- artifact: o.value,
1959
- code: i
1966
+ artifactId: r.value.id,
1967
+ artifact: r.value,
1968
+ code: l
1960
1969
  });
1961
1970
  }
1962
- function xt() {
1963
- clearTimeout(ye), oe.value = !1, j.value && o.value && (x.bridge.setIframe(j.value), x.bridge.loadArtifact(o.value));
1971
+ function Vt() {
1972
+ clearTimeout(O), ve.value = !1, D.value && r.value && (x.bridge.setIframe(D.value), x.bridge.loadArtifact(r.value));
1964
1973
  }
1965
- function $t() {
1966
- clearTimeout(ye), oe.value = !1;
1974
+ function It() {
1975
+ clearTimeout(O), ve.value = !1;
1967
1976
  }
1968
- function Mt() {
1969
- clearTimeout(ye), ye = setTimeout(() => {
1970
- oe.value = !1;
1977
+ function Ft() {
1978
+ clearTimeout(O), O = setTimeout(() => {
1979
+ ve.value = !1;
1971
1980
  }, 1e3);
1972
1981
  }
1973
- async function Tt() {
1974
- if (o.value)
1982
+ async function Rt() {
1983
+ if (r.value)
1975
1984
  try {
1976
- await navigator.clipboard.writeText(o.value.code), Z.value = !0, setTimeout(() => {
1977
- Z.value = !1;
1985
+ await navigator.clipboard.writeText(r.value.code), K.value = !0, setTimeout(() => {
1986
+ K.value = !1;
1978
1987
  }, 2e3);
1979
- } catch (i) {
1980
- console.error("Failed to copy:", i);
1988
+ } catch (l) {
1989
+ console.error("Failed to copy:", l);
1981
1990
  }
1982
1991
  }
1983
- function Lt() {
1984
- if (!o.value) return;
1985
- const { code: i, language: t, title: p } = o.value, F = Ne(t), J = `${p.toLowerCase().replace(/\s+/g, "-")}.${F}`, me = new Blob([i], { type: "text/plain" }), ue = URL.createObjectURL(me), ne = document.createElement("a");
1986
- ne.href = ue, ne.download = J, document.body.appendChild(ne), ne.click(), document.body.removeChild(ne), URL.revokeObjectURL(ue);
1992
+ function qt() {
1993
+ if (!r.value) return;
1994
+ const { code: l, language: t, title: u } = r.value, z = Ke(t), X = `${u.toLowerCase().replace(/\s+/g, "-")}.${z}`, ye = new Blob([l], { type: "text/plain" }), pe = URL.createObjectURL(ye), ue = document.createElement("a");
1995
+ ue.href = pe, ue.download = X, document.body.appendChild(ue), ue.click(), document.body.removeChild(ue), URL.revokeObjectURL(pe);
1987
1996
  }
1988
- async function Pt() {
1989
- if (!(ee.value || d.value.length === 0)) {
1990
- ee.value = !0;
1997
+ async function Ot() {
1998
+ if (!(ae.value || fe.value.length === 0)) {
1999
+ ae.value = !0;
1991
2000
  try {
1992
- const i = new Qt(), t = /* @__PURE__ */ new Map();
1993
- for (const ne of d.value) {
1994
- if (!ne.code) continue;
1995
- const be = Ne(ne.language);
1996
- let ge = (ne.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Ue = `${ge}.${be}`;
1997
- const De = t.get(Ue) || 0;
1998
- De > 0 && (Ue = `${ge}-${De}.${be}`), t.set(`${ge}.${be}`, De + 1), i.file(Ue, ne.code);
2001
+ const l = new ua(), t = /* @__PURE__ */ new Map();
2002
+ for (const ue of fe.value) {
2003
+ if (!ue.code) continue;
2004
+ const $e = Ke(ue.language);
2005
+ let ge = (ue.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Je = `${ge}.${$e}`;
2006
+ const Xe = t.get(Je) || 0;
2007
+ Xe > 0 && (Je = `${ge}-${Xe}.${$e}`), t.set(`${ge}.${$e}`, Xe + 1), l.file(Je, ue.code);
1999
2008
  }
2000
- const p = await i.generateAsync({ type: "blob" }), J = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, me = URL.createObjectURL(p), ue = document.createElement("a");
2001
- ue.href = me, ue.download = J, document.body.appendChild(ue), ue.click(), document.body.removeChild(ue), URL.revokeObjectURL(me);
2002
- } catch (i) {
2003
- console.error("Failed to create ZIP:", i);
2009
+ const u = await l.generateAsync({ type: "blob" }), X = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, ye = URL.createObjectURL(u), pe = document.createElement("a");
2010
+ pe.href = ye, pe.download = X, document.body.appendChild(pe), pe.click(), document.body.removeChild(pe), URL.revokeObjectURL(ye);
2011
+ } catch (l) {
2012
+ console.error("Failed to create ZIP:", l);
2004
2013
  } finally {
2005
- ee.value = !1;
2014
+ ae.value = !1;
2006
2015
  }
2007
2016
  }
2008
2017
  }
2009
- function At() {
2010
- if (re.value) {
2011
- re.value = !1;
2018
+ function Ut() {
2019
+ if (E.value) {
2020
+ E.value = !1;
2012
2021
  return;
2013
2022
  }
2014
- o.value && (P.value = "options", Q.value = "", w.value = null, L.value = "", r.value = !1, B.value = !1, u.value = [], z.value = !1, le.value = "", re.value = !0);
2023
+ r.value && (i.value = "options", H.value = "", d.value = null, L.value = "", se.value = !1, ce.value = !1, we.value = [], be.value = !1, Le.value = "", E.value = !0);
2015
2024
  }
2016
- function Ht() {
2017
- re.value = !1;
2025
+ function Dt() {
2026
+ E.value = !1;
2018
2027
  }
2019
- function Ye(i) {
2020
- return i ? new Date(i).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "";
2028
+ function it(l) {
2029
+ return l ? new Date(l).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "";
2021
2030
  }
2022
- async function Qe() {
2023
- if (!(!o.value || !x.share)) {
2024
- P.value = "loading", L.value = "";
2031
+ async function nt() {
2032
+ if (!(!r.value || !x.share)) {
2033
+ i.value = "loading", L.value = "";
2025
2034
  try {
2026
- const i = await x.share.share(o.value);
2027
- Q.value = i.url, w.value = i.expiresAt, B.value = !1, P.value = "success";
2028
- } catch (i) {
2029
- L.value = i.message || "Failed to create share link", P.value = "error";
2035
+ const l = await x.share.share(r.value);
2036
+ H.value = l.url, d.value = l.expiresAt, ce.value = !1, i.value = "success";
2037
+ } catch (l) {
2038
+ L.value = l.message || "Failed to create share link", i.value = "error";
2030
2039
  }
2031
2040
  }
2032
2041
  }
2033
- async function Ge() {
2034
- if (Je.value)
2035
- Re();
2042
+ async function ot() {
2043
+ if (tt.value)
2044
+ je();
2036
2045
  else {
2037
- P.value = "loading";
2046
+ i.value = "loading";
2038
2047
  try {
2039
- await x.share.openAuthPopup(), Re();
2040
- } catch (i) {
2041
- i.message === "Authentication cancelled" ? P.value = "options" : (L.value = i.message || "Authentication failed", P.value = "error");
2048
+ await x.share.openAuthPopup(), je();
2049
+ } catch (l) {
2050
+ l.message === "Authentication cancelled" ? i.value = "options" : (L.value = l.message || "Authentication failed", i.value = "error");
2042
2051
  }
2043
2052
  }
2044
2053
  }
2045
- async function Re() {
2046
- if (!(!o.value || !x.share)) {
2047
- P.value = "loading", L.value = "";
2054
+ async function je() {
2055
+ if (!(!r.value || !x.share)) {
2056
+ i.value = "loading", L.value = "";
2048
2057
  try {
2049
- const i = await x.share.save(o.value);
2050
- Q.value = i.url, w.value = null, B.value = !0, P.value = "success";
2051
- } catch (i) {
2052
- L.value = i.message || "Failed to save artifact", P.value = "error";
2058
+ const l = await x.share.save(r.value);
2059
+ H.value = l.url, d.value = null, ce.value = !0, i.value = "success";
2060
+ } catch (l) {
2061
+ L.value = l.message || "Failed to save artifact", i.value = "error";
2053
2062
  }
2054
2063
  }
2055
2064
  }
2056
- function Et() {
2057
- B.value ? Re() : Qe();
2065
+ function jt() {
2066
+ ce.value ? je() : nt();
2058
2067
  }
2059
- async function Bt() {
2060
- var i;
2068
+ async function Nt() {
2069
+ var l;
2061
2070
  if (x.share) {
2062
- if (!Je.value) {
2063
- P.value = "loading";
2071
+ if (!tt.value) {
2072
+ i.value = "loading";
2064
2073
  try {
2065
2074
  await x.share.openAuthPopup();
2066
2075
  } catch (t) {
2067
- t.message === "Authentication cancelled" ? P.value = "options" : (L.value = t.message || "Authentication failed", P.value = "error");
2076
+ t.message === "Authentication cancelled" ? i.value = "options" : (L.value = t.message || "Authentication failed", i.value = "error");
2068
2077
  return;
2069
2078
  }
2070
2079
  }
2071
- P.value = "update-list", z.value = !0;
2080
+ i.value = "update-list", be.value = !0;
2072
2081
  try {
2073
- const t = ((i = o.value) == null ? void 0 : i.language) || null, p = await x.share.listArtifacts(t);
2074
- u.value = p.projects || [];
2082
+ const t = ((l = r.value) == null ? void 0 : l.language) || null, u = await x.share.listArtifacts(t);
2083
+ we.value = u.projects || [];
2075
2084
  } catch (t) {
2076
- L.value = t.message || "Failed to load artifacts", P.value = "error";
2085
+ L.value = t.message || "Failed to load artifacts", i.value = "error";
2077
2086
  } finally {
2078
- z.value = !1;
2087
+ be.value = !1;
2079
2088
  }
2080
2089
  }
2081
2090
  }
2082
- async function St(i) {
2083
- var p, F;
2084
- if (!o.value || !x.share) return;
2085
- const t = (p = i.project) == null ? void 0 : p.uuid;
2091
+ async function Wt(l) {
2092
+ var u, z;
2093
+ if (!r.value || !x.share) return;
2094
+ const t = (u = l.project) == null ? void 0 : u.uuid;
2086
2095
  if (t) {
2087
- P.value = "loading", L.value = "";
2096
+ i.value = "loading", L.value = "";
2088
2097
  try {
2089
- const J = await x.share.updateArtifact(t, o.value);
2090
- Q.value = J.url || "", w.value = null, B.value = !0, le.value = ((F = i.project) == null ? void 0 : F.name) || "Untitled", P.value = "success";
2091
- } catch (J) {
2092
- L.value = J.message || "Failed to update artifact", P.value = "error";
2098
+ const X = await x.share.updateArtifact(t, r.value);
2099
+ H.value = X.url || "", d.value = null, ce.value = !0, Le.value = ((z = l.project) == null ? void 0 : z.name) || "Untitled", i.value = "success";
2100
+ } catch (X) {
2101
+ L.value = X.message || "Failed to update artifact", i.value = "error";
2093
2102
  }
2094
2103
  }
2095
2104
  }
2096
- async function zt() {
2097
- if (Q.value)
2105
+ async function Jt() {
2106
+ if (H.value)
2098
2107
  try {
2099
- await navigator.clipboard.writeText(Q.value), r.value = !0, setTimeout(() => {
2100
- r.value = !1;
2108
+ await navigator.clipboard.writeText(H.value), se.value = !0, setTimeout(() => {
2109
+ se.value = !1;
2101
2110
  }, 2e3);
2102
- } catch (i) {
2103
- console.error("Failed to copy link:", i);
2111
+ } catch (l) {
2112
+ console.error("Failed to copy link:", l);
2104
2113
  }
2105
2114
  }
2106
- function et() {
2107
- A.value && window.open(A.value, "_blank", "noopener,noreferrer");
2115
+ function rt() {
2116
+ G.value && window.open(G.value, "_blank", "noopener,noreferrer");
2108
2117
  }
2109
- function Vt() {
2110
- Y.value && S.value && (Y.value.style.transform = `translateY(-${S.value.scrollTop}px)`);
2118
+ function Xt() {
2119
+ ee.value && B.value && (ee.value.style.transform = `translateY(-${B.value.scrollTop}px)`);
2111
2120
  }
2112
- function It() {
2113
- X.value = !X.value;
2121
+ function Zt() {
2122
+ Z.value = !Z.value;
2114
2123
  }
2115
- function tt(i) {
2116
- k.value = !0, I(i), X.value = !1;
2124
+ function ct(l) {
2125
+ k.value = !0, V(l), Z.value = !1;
2117
2126
  }
2118
- function Ft() {
2119
- const i = U.value - 1;
2120
- i >= 0 && I(d.value[i]);
2127
+ function Kt() {
2128
+ const l = Pe.value - 1;
2129
+ l >= 0 && V(fe.value[l]);
2121
2130
  }
2122
- function Rt() {
2123
- const i = U.value + 1;
2124
- i < d.value.length && I(d.value[i]);
2131
+ function Yt() {
2132
+ const l = Pe.value + 1;
2133
+ l < fe.value.length && V(fe.value[l]);
2125
2134
  }
2126
- function at(i) {
2135
+ function ut(l) {
2127
2136
  const t = document.querySelector(".artifactuse-panel__nav");
2128
- t && !t.contains(i.target) && (X.value = !1);
2129
- }
2130
- let we = null;
2131
- function qt(i) {
2132
- we = {
2133
- startX: i.clientX,
2134
- startWidth: b.value
2135
- }, document.addEventListener("mousemove", st), document.addEventListener("mouseup", qe), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((p) => p.style.pointerEvents = "none");
2136
- }
2137
- function st(i) {
2138
- if (!we) return;
2139
- const t = window.innerWidth, F = (we.startX - i.clientX) / t * 100, J = we.startWidth + F;
2140
- b.value = Math.min(Math.max(J, 25), 75), _("resize", { width: b.value });
2141
- }
2142
- function qe() {
2143
- const i = we !== null;
2144
- we = null, document.removeEventListener("mousemove", st), document.removeEventListener("mouseup", qe), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((p) => p.style.pointerEvents = ""), i && _("resize", { width: b.value });
2145
- }
2146
- let Le = null;
2147
- function Ot(i) {
2148
- if (!W.value) return;
2149
- const t = W.value.getBoundingClientRect();
2150
- Le = {
2151
- startX: i.clientX,
2152
- startPosition: V.value,
2137
+ t && !t.contains(l.target) && (Z.value = !1);
2138
+ }
2139
+ let xe = null;
2140
+ function Qt(l) {
2141
+ xe = {
2142
+ startX: l.clientX,
2143
+ startWidth: te.value
2144
+ }, document.addEventListener("mousemove", dt), document.addEventListener("mouseup", Ne), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((u) => u.style.pointerEvents = "none");
2145
+ }
2146
+ function dt(l) {
2147
+ if (!xe) return;
2148
+ const t = window.innerWidth, z = (xe.startX - l.clientX) / t * 100, X = xe.startWidth + z;
2149
+ te.value = Math.min(Math.max(X, 25), 75), _("resize", { width: te.value });
2150
+ }
2151
+ function Ne() {
2152
+ const l = xe !== null;
2153
+ xe = null, document.removeEventListener("mousemove", dt), document.removeEventListener("mouseup", Ne), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((u) => u.style.pointerEvents = ""), l && _("resize", { width: te.value });
2154
+ }
2155
+ let Ae = null;
2156
+ function Gt(l) {
2157
+ if (!N.value) return;
2158
+ const t = N.value.getBoundingClientRect();
2159
+ Ae = {
2160
+ startX: l.clientX,
2161
+ startPosition: f.value,
2153
2162
  contentLeft: t.left,
2154
2163
  contentWidth: t.width
2155
- }, document.addEventListener("mousemove", it), document.addEventListener("mouseup", Oe), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((F) => F.style.pointerEvents = "none");
2164
+ }, document.addEventListener("mousemove", vt), document.addEventListener("mouseup", We), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((z) => z.style.pointerEvents = "none");
2156
2165
  }
2157
- function it(i) {
2158
- if (!Le) return;
2159
- const p = (i.clientX - Le.contentLeft) / Le.contentWidth * 100;
2160
- V.value = Math.min(Math.max(p, 20), 80);
2166
+ function vt(l) {
2167
+ if (!Ae) return;
2168
+ const u = (l.clientX - Ae.contentLeft) / Ae.contentWidth * 100;
2169
+ f.value = Math.min(Math.max(u, 20), 80);
2161
2170
  }
2162
- function Oe() {
2163
- Le = null, document.removeEventListener("mousemove", it), document.removeEventListener("mouseup", Oe), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((t) => t.style.pointerEvents = "");
2171
+ function We() {
2172
+ Ae = null, document.removeEventListener("mousemove", vt), document.removeEventListener("mouseup", We), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((t) => t.style.pointerEvents = "");
2164
2173
  }
2165
- return de(o, (i, t) => {
2166
- i && (t && t.isPreviewable !== i.isPreviewable && (m.value = !0, setTimeout(() => {
2174
+ return oe(r, (l, t) => {
2175
+ l && (t && t.isPreviewable !== l.isPreviewable && (m.value = !0, setTimeout(() => {
2167
2176
  m.value = !1;
2168
- }, 150)), (!t || i.id !== t.id) && (bt(), oe.value = !0, Mt()), (!t || i.id !== t.id || i.code !== t.code) && (Ae(), f.viewMode === "edit" && (!t || i.id !== t.id ? Ce(() => Ke()) : fe && fe.setCode(i.code || "")), clearTimeout(pe), pe = setTimeout(() => {
2169
- j.value && i.isPreviewable && x.bridge.loadArtifact(i);
2177
+ }, 150)), (!t || l.id !== t.id) && (St(), ve.value = !0, Ft()), (!t || l.id !== t.id || l.code !== t.code) && (Be(), p.viewMode === "edit" && (!t || l.id !== t.id ? ke(() => lt()) : J && J.setCode(l.code || "")), clearTimeout(R), R = setTimeout(() => {
2178
+ D.value && l.isPreviewable && x.bridge.loadArtifact(l);
2170
2179
  }, 500)));
2171
- }, { deep: !0 }), de(() => f.viewMode, (i) => {
2172
- (i === "code" || i === "split") && Ae(), i === "edit" && Ce(() => Ke());
2173
- }), de(() => f.isPanelOpen, (i) => {
2174
- i && o.value && Ae(), i || Fe();
2175
- }), de(() => M.panelWidth, (i) => {
2176
- i !== void 0 && (b.value = Math.min(Math.max(i, 25), 75));
2177
- }), de(() => M.splitPosition, (i) => {
2178
- i !== void 0 && (V.value = Math.min(Math.max(i, 20), 80));
2179
- }), $e(() => {
2180
- x.on("ai:request", (i) => _("ai-request", i)), x.on("save:request", (i) => _("save", i)), x.on("export:complete", (i) => _("export", i)), document.addEventListener("click", at), f.isPanelOpen && o.value && Ae();
2181
- }), We(() => {
2182
- qe(), Oe(), Fe(), document.removeEventListener("click", at), clearTimeout(pe), clearTimeout(ye);
2183
- }), (i, t) => (a(), xe(Ee, { name: "artifactuse-panel" }, {
2184
- default: Be(() => [
2185
- y(f).isPanelOpen ? (a(), s("div", {
2180
+ }, { deep: !0 }), oe(() => p.viewMode, (l) => {
2181
+ (l === "code" || l === "split") && Be(), l === "edit" && ke(() => lt());
2182
+ }), oe(() => p.isPanelOpen, (l) => {
2183
+ l && r.value && Be(), l || De();
2184
+ }), oe(() => {
2185
+ var l;
2186
+ return (l = r.value) == null ? void 0 : l.id;
2187
+ }, () => {
2188
+ Q.value = [], W.value = !1;
2189
+ }), oe([Q, W], () => {
2190
+ ie.value && W.value && ke(() => {
2191
+ ie.value.scrollTop = ie.value.scrollHeight;
2192
+ });
2193
+ }), oe(() => T.panelWidth, (l) => {
2194
+ l !== void 0 && (te.value = Math.min(Math.max(l, 25), 75));
2195
+ }), oe(() => T.splitPosition, (l) => {
2196
+ l !== void 0 && (f.value = Math.min(Math.max(l, 20), 80));
2197
+ }), Te(() => {
2198
+ x.on("ai:request", (l) => _("ai-request", l)), x.on("save:request", (l) => _("save", l)), x.on("export:complete", (l) => _("export", l)), x && (C = x.on("console:log", ({ entry: l }) => {
2199
+ Q.value = [...Q.value, l].slice(-500), l.type === "error" && (W.value = !0);
2200
+ })), document.addEventListener("click", ut), p.isPanelOpen && r.value && Be();
2201
+ }), Ye(() => {
2202
+ Ne(), We(), De(), document.removeEventListener("click", ut), clearTimeout(R), clearTimeout(O), C && C();
2203
+ }), (l, t) => (a(), Me(ze, { name: "artifactuse-panel" }, {
2204
+ default: Ve(() => [
2205
+ y(p).isPanelOpen ? (a(), s("div", {
2186
2206
  key: 0,
2187
- class: N(["artifactuse-panel", {
2188
- "artifactuse-panel--fullscreen": y(f).isFullscreen,
2189
- "artifactuse-panel--list": !y(o) && y(E) && !y(f).forceEmptyView,
2190
- "artifactuse-panel--empty": !y(E) && !y(f).forceEmptyView
2207
+ class: I(["artifactuse-panel", {
2208
+ "artifactuse-panel--fullscreen": y(p).isFullscreen,
2209
+ "artifactuse-panel--list": !y(r) && y(A) && !y(p).forceEmptyView,
2210
+ "artifactuse-panel--empty": !y(A) && !y(p).forceEmptyView
2191
2211
  }]),
2192
- style: He(y(f).isFullscreen ? void 0 : { width: `${_t.value}%` })
2212
+ style: Se(y(p).isFullscreen ? void 0 : { width: `${Tt.value}%` })
2193
2213
  }, [
2194
- y(f).isFullscreen ? v("", !0) : (a(), s("div", {
2214
+ y(p).isFullscreen ? v("", !0) : (a(), s("div", {
2195
2215
  key: 0,
2196
2216
  class: "artifactuse-panel__resize-handle",
2197
- onMousedown: he(qt, ["prevent"])
2198
- }, [...t[12] || (t[12] = [
2217
+ onMousedown: _e(Qt, ["prevent"])
2218
+ }, [...t[19] || (t[19] = [
2199
2219
  e("div", { class: "artifactuse-panel__resize-handle-line" }, null, -1)
2200
2220
  ])], 32)),
2201
- !y(E) || ke.value ? (a(), s(R, { key: 1 }, [
2202
- e("header", vl, [
2203
- e("div", fl, [
2204
- e("span", pl, [
2205
- ke.value ? (a(), s("svg", _l, [...t[13] || (t[13] = [
2221
+ !y(A) || Ce.value ? (a(), s(F, { key: 1 }, [
2222
+ e("header", xi, [
2223
+ e("div", $i, [
2224
+ e("span", Mi, [
2225
+ Ce.value ? (a(), s("svg", Ti, [...t[20] || (t[20] = [
2206
2226
  e("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }, null, -1),
2207
2227
  e("polyline", { points: "14 2 14 8 20 8" }, null, -1)
2208
- ])])) : (a(), s("svg", hl, [...t[14] || (t[14] = [
2228
+ ])])) : (a(), s("svg", Li, [...t[21] || (t[21] = [
2209
2229
  e("polyline", { points: "16 18 22 12 16 6" }, null, -1),
2210
2230
  e("polyline", { points: "8 6 2 12 8 18" }, null, -1)
2211
2231
  ])]))
2212
2232
  ]),
2213
- e("div", ml, [
2214
- e("span", yl, l(ke.value ? "Artifact Viewer" : "Artifacts"), 1)
2233
+ e("div", Pi, [
2234
+ e("span", Ei, n(Ce.value ? "Artifact Viewer" : "Artifacts"), 1)
2215
2235
  ])
2216
2236
  ]),
2217
- e("div", gl, [
2237
+ e("div", Ai, [
2218
2238
  e("button", {
2219
2239
  class: "artifactuse-panel__action artifactuse-panel__action--close",
2220
2240
  title: "Close panel",
2221
- onClick: t[0] || (t[0] = (...p) => y(g) && y(g)(...p))
2222
- }, [...t[15] || (t[15] = [
2241
+ onClick: t[0] || (t[0] = (...u) => y(g) && y(g)(...u))
2242
+ }, [...t[22] || (t[22] = [
2223
2243
  e("svg", {
2224
2244
  viewBox: "0 0 24 24",
2225
2245
  fill: "none",
@@ -2242,8 +2262,8 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2242
2262
  ])])
2243
2263
  ])
2244
2264
  ]),
2245
- e("div", kl, [
2246
- t[16] || (t[16] = e("div", { class: "artifactuse-panel__empty-icon" }, [
2265
+ e("div", Hi, [
2266
+ t[23] || (t[23] = e("div", { class: "artifactuse-panel__empty-icon" }, [
2247
2267
  e("svg", {
2248
2268
  viewBox: "0 0 24 24",
2249
2269
  fill: "none",
@@ -2254,11 +2274,11 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2254
2274
  e("polyline", { points: "14 2 14 8 20 8" })
2255
2275
  ])
2256
2276
  ], -1)),
2257
- e("h3", wl, l(ke.value ? "No artifact selected" : "No artifacts yet"), 1),
2258
- e("p", bl, l(ke.value ? "Open an artifact to have it appear here" : "Code blocks, forms, and other interactive content will appear here as the AI generates them."), 1)
2277
+ e("h3", Bi, n(Ce.value ? "No artifact selected" : "No artifacts yet"), 1),
2278
+ e("p", Si, n(Ce.value ? "Open an artifact to have it appear here" : "Code blocks, forms, and other interactive content will appear here as the AI generates them."), 1)
2259
2279
  ]),
2260
- e("footer", Cl, [
2261
- G.value ? (a(), s("a", xl, [...t[17] || (t[17] = [
2280
+ e("footer", zi, [
2281
+ qe.value ? (a(), s("a", Vi, [...t[24] || (t[24] = [
2262
2282
  e("svg", {
2263
2283
  width: "16",
2264
2284
  height: "16",
@@ -2278,10 +2298,10 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2278
2298
  e("span", null, "Artifactuse", -1)
2279
2299
  ])])) : v("", !0)
2280
2300
  ])
2281
- ], 64)) : !y(o) && !ke.value ? (a(), s(R, { key: 2 }, [
2282
- e("header", $l, [
2283
- e("div", Ml, [
2284
- t[19] || (t[19] = e("span", { class: "artifactuse-panel__icon" }, [
2301
+ ], 64)) : !y(r) && !Ce.value ? (a(), s(F, { key: 2 }, [
2302
+ e("header", Ii, [
2303
+ e("div", Fi, [
2304
+ t[26] || (t[26] = e("span", { class: "artifactuse-panel__icon" }, [
2285
2305
  e("svg", {
2286
2306
  viewBox: "0 0 24 24",
2287
2307
  fill: "none",
@@ -2292,19 +2312,19 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2292
2312
  e("polyline", { points: "8 6 2 12 8 18" })
2293
2313
  ])
2294
2314
  ], -1)),
2295
- e("div", Tl, [
2296
- t[18] || (t[18] = e("span", { class: "artifactuse-panel__name" }, "Artifacts", -1)),
2297
- e("span", Ll, l(d.value.length) + " available", 1)
2315
+ e("div", Ri, [
2316
+ t[25] || (t[25] = e("span", { class: "artifactuse-panel__name" }, "Artifacts", -1)),
2317
+ e("span", qi, n(fe.value.length) + " available", 1)
2298
2318
  ])
2299
2319
  ]),
2300
- e("div", Pl, [
2320
+ e("div", Oi, [
2301
2321
  e("button", {
2302
- class: N(["artifactuse-panel__action", { "artifactuse-panel__action--loading": ee.value }]),
2303
- disabled: ee.value,
2322
+ class: I(["artifactuse-panel__action", { "artifactuse-panel__action--loading": ae.value }]),
2323
+ disabled: ae.value,
2304
2324
  title: "Download all as ZIP",
2305
- onClick: Pt
2325
+ onClick: Ot
2306
2326
  }, [
2307
- ee.value ? (a(), s("svg", El, [...t[21] || (t[21] = [
2327
+ ae.value ? (a(), s("svg", ji, [...t[28] || (t[28] = [
2308
2328
  e("circle", {
2309
2329
  cx: "12",
2310
2330
  cy: "12",
@@ -2312,7 +2332,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2312
2332
  "stroke-dasharray": "32",
2313
2333
  "stroke-dashoffset": "32"
2314
2334
  }, null, -1)
2315
- ])])) : (a(), s("svg", Hl, [...t[20] || (t[20] = [
2335
+ ])])) : (a(), s("svg", Di, [...t[27] || (t[27] = [
2316
2336
  e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }, null, -1),
2317
2337
  e("polyline", { points: "7 10 12 15 17 10" }, null, -1),
2318
2338
  e("line", {
@@ -2322,12 +2342,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2322
2342
  y2: "3"
2323
2343
  }, null, -1)
2324
2344
  ])]))
2325
- ], 10, Al),
2345
+ ], 10, Ui),
2326
2346
  e("button", {
2327
2347
  class: "artifactuse-panel__action artifactuse-panel__action--close",
2328
2348
  title: "Close panel",
2329
- onClick: t[1] || (t[1] = (...p) => y(g) && y(g)(...p))
2330
- }, [...t[22] || (t[22] = [
2349
+ onClick: t[1] || (t[1] = (...u) => y(g) && y(g)(...u))
2350
+ }, [...t[29] || (t[29] = [
2331
2351
  e("svg", {
2332
2352
  viewBox: "0 0 24 24",
2333
2353
  fill: "none",
@@ -2350,27 +2370,27 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2350
2370
  ])])
2351
2371
  ])
2352
2372
  ]),
2353
- e("div", Bl, [
2354
- e("div", Sl, [
2355
- (a(!0), s(R, null, ve(d.value, (p, F) => (a(), s("button", {
2356
- key: p.id,
2373
+ e("div", Ni, [
2374
+ e("div", Wi, [
2375
+ (a(!0), s(F, null, de(fe.value, (u, z) => (a(), s("button", {
2376
+ key: u.id,
2357
2377
  class: "artifactuse-panel__list-item",
2358
- onClick: (J) => tt(p)
2378
+ onClick: (X) => ct(u)
2359
2379
  }, [
2360
2380
  e("span", {
2361
2381
  class: "artifactuse-panel__list-item-icon",
2362
- innerHTML: Ie(p.language)
2363
- }, null, 8, Vl),
2364
- e("div", Il, [
2365
- e("span", Fl, l(p.title || "Untitled"), 1),
2366
- e("span", Rl, [
2367
- K(l(y(Se)(p.language)) + " ", 1),
2368
- p.lineCount ? (a(), s(R, { key: 0 }, [
2369
- K(" • " + l(p.lineCount) + " lines ", 1)
2382
+ innerHTML: Ue(u.language)
2383
+ }, null, 8, Xi),
2384
+ e("div", Zi, [
2385
+ e("span", Ki, n(u.title || "Untitled"), 1),
2386
+ e("span", Yi, [
2387
+ Y(n(y(Ie)(u.language)) + " ", 1),
2388
+ u.lineCount ? (a(), s(F, { key: 0 }, [
2389
+ Y(" • " + n(u.lineCount) + " lines ", 1)
2370
2390
  ], 64)) : v("", !0)
2371
2391
  ])
2372
2392
  ]),
2373
- t[23] || (t[23] = e("span", { class: "artifactuse-panel__list-item-arrow" }, [
2393
+ t[30] || (t[30] = e("span", { class: "artifactuse-panel__list-item-arrow" }, [
2374
2394
  e("svg", {
2375
2395
  viewBox: "0 0 24 24",
2376
2396
  fill: "none",
@@ -2380,11 +2400,11 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2380
2400
  e("polyline", { points: "9 18 15 12 9 6" })
2381
2401
  ])
2382
2402
  ], -1))
2383
- ], 8, zl))), 128))
2403
+ ], 8, Ji))), 128))
2384
2404
  ])
2385
2405
  ]),
2386
- e("footer", ql, [
2387
- G.value ? (a(), s("a", Ol, [...t[24] || (t[24] = [
2406
+ e("footer", Qi, [
2407
+ qe.value ? (a(), s("a", Gi, [...t[31] || (t[31] = [
2388
2408
  e("svg", {
2389
2409
  width: "16",
2390
2410
  height: "16",
@@ -2404,14 +2424,14 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2404
2424
  e("span", null, "Artifactuse", -1)
2405
2425
  ])])) : v("", !0)
2406
2426
  ])
2407
- ], 64)) : (a(), s(R, { key: 3 }, [
2408
- e("header", Ul, [
2409
- Te.value || k.value ? (a(), s("button", {
2427
+ ], 64)) : (a(), s(F, { key: 3 }, [
2428
+ e("header", en, [
2429
+ Ee.value || k.value ? (a(), s("button", {
2410
2430
  key: 0,
2411
2431
  class: "artifactuse-panel__back",
2412
- title: Te.value ? "Browse artifacts" : "Back to list",
2413
- onClick: yt
2414
- }, [...t[25] || (t[25] = [
2432
+ title: Ee.value ? "Browse artifacts" : "Back to list",
2433
+ onClick: Et
2434
+ }, [...t[32] || (t[32] = [
2415
2435
  e("svg", {
2416
2436
  viewBox: "0 0 24 24",
2417
2437
  fill: "none",
@@ -2420,30 +2440,30 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2420
2440
  }, [
2421
2441
  e("polyline", { points: "15 18 9 12 15 6" })
2422
2442
  ], -1)
2423
- ])], 8, Dl)) : v("", !0),
2424
- e("div", jl, [
2443
+ ])], 8, tn)) : v("", !0),
2444
+ e("div", an, [
2425
2445
  e("span", {
2426
2446
  class: "artifactuse-panel__icon",
2427
- innerHTML: te.value
2428
- }, null, 8, Nl),
2429
- e("div", Wl, [
2430
- e("span", Jl, l(y(o).title || "Untitled"), 1),
2431
- e("span", Xl, [
2432
- K(l(D.value) + " ", 1),
2433
- y(o).lineCount ? (a(), s(R, { key: 0 }, [
2434
- K(" • " + l(y(o).lineCount) + " lines ", 1)
2447
+ innerHTML: le.value
2448
+ }, null, 8, sn),
2449
+ e("div", ln, [
2450
+ e("span", nn, n(y(r).title || "Untitled"), 1),
2451
+ e("span", on, [
2452
+ Y(n(j.value) + " ", 1),
2453
+ y(r).lineCount ? (a(), s(F, { key: 0 }, [
2454
+ Y(" • " + n(y(r).lineCount) + " lines ", 1)
2435
2455
  ], 64)) : v("", !0)
2436
2456
  ])
2437
2457
  ])
2438
2458
  ]),
2439
- e("div", Zl, [
2440
- !y(o).tabs || y(o).tabs.includes("preview") ? (a(), s("button", {
2459
+ e("div", rn, [
2460
+ !y(r).tabs || y(r).tabs.includes("preview") ? (a(), s("button", {
2441
2461
  key: 0,
2442
- class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "preview" }]),
2443
- disabled: !y(o).isPreviewable,
2462
+ class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "preview" }]),
2463
+ disabled: !y(r).isPreviewable,
2444
2464
  title: "Preview",
2445
- onClick: t[2] || (t[2] = (p) => y(h)("preview"))
2446
- }, [...t[26] || (t[26] = [
2465
+ onClick: t[2] || (t[2] = (u) => y(h)("preview"))
2466
+ }, [...t[33] || (t[33] = [
2447
2467
  e("svg", {
2448
2468
  viewBox: "0 0 24 24",
2449
2469
  fill: "none",
@@ -2457,13 +2477,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2457
2477
  r: "3"
2458
2478
  })
2459
2479
  ], -1)
2460
- ])], 10, Kl)) : v("", !0),
2461
- !y(o).tabs || y(o).tabs.includes("code") ? (a(), s("button", {
2480
+ ])], 10, cn)) : v("", !0),
2481
+ !y(r).tabs || y(r).tabs.includes("code") ? (a(), s("button", {
2462
2482
  key: 1,
2463
- class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "code" }]),
2483
+ class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "code" }]),
2464
2484
  title: "Code",
2465
- onClick: t[3] || (t[3] = (p) => y(h)("code"))
2466
- }, [...t[27] || (t[27] = [
2485
+ onClick: t[3] || (t[3] = (u) => y(h)("code"))
2486
+ }, [...t[34] || (t[34] = [
2467
2487
  e("svg", {
2468
2488
  viewBox: "0 0 24 24",
2469
2489
  fill: "none",
@@ -2474,13 +2494,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2474
2494
  e("polyline", { points: "8 6 2 12 8 18" })
2475
2495
  ], -1)
2476
2496
  ])], 2)) : v("", !0),
2477
- !y(o).tabs || y(o).tabs.includes("split") ? (a(), s("button", {
2497
+ !y(r).tabs || y(r).tabs.includes("split") ? (a(), s("button", {
2478
2498
  key: 2,
2479
- class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "split" }]),
2480
- disabled: !y(o).isPreviewable,
2499
+ class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "split" }]),
2500
+ disabled: !y(r).isPreviewable,
2481
2501
  title: "Split view",
2482
- onClick: t[4] || (t[4] = (p) => y(h)("split"))
2483
- }, [...t[28] || (t[28] = [
2502
+ onClick: t[4] || (t[4] = (u) => y(h)("split"))
2503
+ }, [...t[35] || (t[35] = [
2484
2504
  e("svg", {
2485
2505
  viewBox: "0 0 24 24",
2486
2506
  fill: "none",
@@ -2502,13 +2522,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2502
2522
  y2: "21"
2503
2523
  })
2504
2524
  ], -1)
2505
- ])], 10, Yl)) : v("", !0),
2506
- y(o).tabs && y(o).tabs.includes("edit") && Pe.value ? (a(), s("button", {
2525
+ ])], 10, un)) : v("", !0),
2526
+ y(r).tabs && y(r).tabs.includes("edit") && S.value ? (a(), s("button", {
2507
2527
  key: 3,
2508
- class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(f).viewMode === "edit" }]),
2528
+ class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "edit" }]),
2509
2529
  title: "Edit",
2510
- onClick: t[5] || (t[5] = (p) => y(h)("edit"))
2511
- }, [...t[29] || (t[29] = [
2530
+ onClick: t[5] || (t[5] = (u) => y(h)("edit"))
2531
+ }, [...t[36] || (t[36] = [
2512
2532
  e("svg", {
2513
2533
  viewBox: "0 0 24 24",
2514
2534
  fill: "none",
@@ -2520,13 +2540,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2520
2540
  ], -1)
2521
2541
  ])], 2)) : v("", !0)
2522
2542
  ]),
2523
- e("div", Ql, [
2524
- y(f).viewMode === "edit" ? (a(), s("button", {
2543
+ e("div", dn, [
2544
+ y(p).viewMode === "edit" ? (a(), s("button", {
2525
2545
  key: 0,
2526
2546
  class: "artifactuse-panel__action artifactuse-panel__action--save",
2527
2547
  title: "Save",
2528
- onClick: Ct
2529
- }, [...t[30] || (t[30] = [
2548
+ onClick: zt
2549
+ }, [...t[37] || (t[37] = [
2530
2550
  e("svg", {
2531
2551
  viewBox: "0 0 24 24",
2532
2552
  fill: "none",
@@ -2538,12 +2558,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2538
2558
  e("polyline", { points: "7 3 7 8 15 8" })
2539
2559
  ], -1)
2540
2560
  ])])) : v("", !0),
2541
- ce.value ? (a(), s("button", {
2561
+ Ct.value ? (a(), s("button", {
2542
2562
  key: 1,
2543
2563
  class: "artifactuse-panel__action",
2544
2564
  title: "Open in new tab",
2545
- onClick: et
2546
- }, [...t[31] || (t[31] = [
2565
+ onClick: rt
2566
+ }, [...t[38] || (t[38] = [
2547
2567
  e("svg", {
2548
2568
  viewBox: "0 0 24 24",
2549
2569
  fill: "none",
@@ -2562,10 +2582,10 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2562
2582
  ])])) : v("", !0),
2563
2583
  e("button", {
2564
2584
  class: "artifactuse-panel__action",
2565
- title: y(f).isFullscreen ? "Exit fullscreen" : "Fullscreen",
2566
- onClick: t[6] || (t[6] = (...p) => y(n) && y(n)(...p))
2585
+ title: y(p).isFullscreen ? "Exit fullscreen" : "Fullscreen",
2586
+ onClick: t[6] || (t[6] = (...u) => y(o) && y(o)(...u))
2567
2587
  }, [
2568
- y(f).isFullscreen ? (a(), s("svg", tn, [...t[33] || (t[33] = [
2588
+ y(p).isFullscreen ? (a(), s("svg", pn, [...t[40] || (t[40] = [
2569
2589
  e("polyline", { points: "4 14 10 14 10 20" }, null, -1),
2570
2590
  e("polyline", { points: "20 10 14 10 14 4" }, null, -1),
2571
2591
  e("line", {
@@ -2580,7 +2600,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2580
2600
  x2: "10",
2581
2601
  y2: "14"
2582
2602
  }, null, -1)
2583
- ])])) : (a(), s("svg", en, [...t[32] || (t[32] = [
2603
+ ])])) : (a(), s("svg", fn, [...t[39] || (t[39] = [
2584
2604
  e("polyline", { points: "15 3 21 3 21 9" }, null, -1),
2585
2605
  e("polyline", { points: "9 21 3 21 3 15" }, null, -1),
2586
2606
  e("line", {
@@ -2596,12 +2616,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2596
2616
  y2: "14"
2597
2617
  }, null, -1)
2598
2618
  ])]))
2599
- ], 8, Gl),
2619
+ ], 8, vn),
2600
2620
  e("button", {
2601
2621
  class: "artifactuse-panel__action artifactuse-panel__action--close",
2602
2622
  title: "Close panel",
2603
- onClick: t[7] || (t[7] = (...p) => y(g) && y(g)(...p))
2604
- }, [...t[34] || (t[34] = [
2623
+ onClick: t[7] || (t[7] = (...u) => y(g) && y(g)(...u))
2624
+ }, [...t[41] || (t[41] = [
2605
2625
  e("svg", {
2606
2626
  viewBox: "0 0 24 24",
2607
2627
  fill: "none",
@@ -2624,25 +2644,25 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2624
2644
  ])])
2625
2645
  ])
2626
2646
  ]),
2627
- Te.value && Xe.value.length > 0 ? (a(), s("div", an, [
2628
- e("div", sn, [
2629
- (a(!0), s(R, null, ve(Xe.value, (p) => {
2630
- var F;
2647
+ Ee.value && at.value.length > 0 ? (a(), s("div", _n, [
2648
+ e("div", hn, [
2649
+ (a(!0), s(F, null, de(at.value, (u) => {
2650
+ var z;
2631
2651
  return a(), s("button", {
2632
- key: p.id,
2633
- class: N(["artifactuse-panel__file-tab", { "artifactuse-panel__file-tab--active": p.id === ((F = y(o)) == null ? void 0 : F.id) }]),
2634
- onClick: (J) => ht(p)
2652
+ key: u.id,
2653
+ class: I(["artifactuse-panel__file-tab", { "artifactuse-panel__file-tab--active": u.id === ((z = y(r)) == null ? void 0 : z.id) }]),
2654
+ onClick: (X) => Lt(u)
2635
2655
  }, [
2636
2656
  e("span", {
2637
2657
  class: "artifactuse-panel__file-tab-icon",
2638
- innerHTML: Ie(p.language)
2639
- }, null, 8, nn),
2640
- e("span", on, l(p.title || "Untitled"), 1),
2658
+ innerHTML: Ue(u.language)
2659
+ }, null, 8, yn),
2660
+ e("span", gn, n(u.title || "Untitled"), 1),
2641
2661
  e("button", {
2642
2662
  class: "artifactuse-panel__file-tab-close",
2643
2663
  title: "Close tab",
2644
- onClick: he((J) => mt(p.id), ["stop"])
2645
- }, [...t[35] || (t[35] = [
2664
+ onClick: _e((X) => Pt(u.id), ["stop"])
2665
+ }, [...t[42] || (t[42] = [
2646
2666
  e("svg", {
2647
2667
  viewBox: "0 0 24 24",
2648
2668
  fill: "none",
@@ -2662,42 +2682,42 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2662
2682
  y2: "18"
2663
2683
  })
2664
2684
  ], -1)
2665
- ])], 8, rn)
2666
- ], 10, ln);
2685
+ ])], 8, kn)
2686
+ ], 10, mn);
2667
2687
  }), 128))
2668
2688
  ])
2669
2689
  ])) : v("", !0),
2670
2690
  e("div", {
2671
2691
  ref_key: "contentRef",
2672
- ref: W,
2673
- class: N(["artifactuse-panel__content", [
2674
- `artifactuse-panel__content--${y(f).viewMode}`,
2692
+ ref: N,
2693
+ class: I(["artifactuse-panel__content", [
2694
+ `artifactuse-panel__content--${y(p).viewMode}`,
2675
2695
  { "artifactuse-panel__content--transitioning": m.value }
2676
2696
  ]])
2677
2697
  }, [
2678
- m.value ? (a(), s("div", cn, [...t[36] || (t[36] = [
2698
+ m.value ? (a(), s("div", wn, [...t[43] || (t[43] = [
2679
2699
  e("div", { class: "artifactuse-panel__spinner" }, null, -1)
2680
2700
  ])])) : v("", !0),
2681
- y(f).viewMode === "preview" || y(f).viewMode === "split" ? (a(), s("div", {
2701
+ y(p).viewMode === "preview" || y(p).viewMode === "split" ? (a(), s("div", {
2682
2702
  key: 1,
2683
2703
  class: "artifactuse-panel__preview",
2684
- style: He(y(f).viewMode === "split" ? { width: `${V.value}%` } : void 0)
2704
+ style: Se(y(p).viewMode === "split" ? { width: `${f.value}%` } : void 0)
2685
2705
  }, [
2686
- oe.value && A.value ? (a(), s("div", un, [...t[37] || (t[37] = [
2706
+ ve.value && G.value ? (a(), s("div", bn, [...t[44] || (t[44] = [
2687
2707
  e("div", { class: "artifactuse-panel__spinner" }, null, -1)
2688
2708
  ])])) : v("", !0),
2689
- A.value ? (a(), s("iframe", {
2709
+ G.value ? (a(), s("iframe", {
2690
2710
  key: 1,
2691
2711
  ref_key: "iframeRef",
2692
- ref: j,
2693
- src: A.value,
2694
- class: N(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": oe.value }]),
2712
+ ref: D,
2713
+ src: G.value,
2714
+ class: I(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": ve.value }]),
2695
2715
  sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
2696
2716
  allow: "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write; encrypted-media; gyroscope; accelerometer; picture-in-picture",
2697
- onLoad: xt,
2698
- onError: $t
2699
- }, null, 42, dn)) : (a(), s("div", vn, [
2700
- t[38] || (t[38] = e("svg", {
2717
+ onLoad: Vt,
2718
+ onError: It
2719
+ }, null, 42, Cn)) : (a(), s("div", xn, [
2720
+ t[45] || (t[45] = e("svg", {
2701
2721
  viewBox: "0 0 24 24",
2702
2722
  fill: "none",
2703
2723
  stroke: "currentColor",
@@ -2712,58 +2732,123 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2712
2732
  y2: "12"
2713
2733
  })
2714
2734
  ], -1)),
2715
- e("p", null, "Preview not available for " + l(D.value), 1)
2735
+ e("p", null, "Preview not available for " + n(j.value), 1)
2716
2736
  ]))
2717
2737
  ], 4)) : v("", !0),
2718
- ot(e("div", {
2738
+ _t(e("div", {
2719
2739
  class: "artifactuse-panel__code",
2720
- style: He(y(f).viewMode === "split" ? { width: `${100 - V.value}%` } : void 0)
2740
+ style: Se(y(p).viewMode === "split" ? { width: `${100 - f.value}%` } : void 0)
2721
2741
  }, [
2722
- y(f).viewMode === "split" ? (a(), s("div", {
2742
+ y(p).viewMode === "split" ? (a(), s("div", {
2723
2743
  key: 0,
2724
2744
  class: "artifactuse-panel__split-handle",
2725
- onMousedown: he(Ot, ["prevent"])
2726
- }, [...t[39] || (t[39] = [
2745
+ onMousedown: _e(Gt, ["prevent"])
2746
+ }, [...t[46] || (t[46] = [
2727
2747
  e("div", { class: "artifactuse-panel__split-handle-line" }, null, -1)
2728
2748
  ])], 32)) : v("", !0),
2729
2749
  e("div", {
2730
2750
  class: "artifactuse-panel__code-scroll",
2731
2751
  ref_key: "codeScrollRef",
2732
- ref: S,
2733
- onScroll: Vt
2752
+ ref: B,
2753
+ onScroll: Xt
2734
2754
  }, [
2735
2755
  e("div", {
2736
2756
  class: "artifactuse-panel__line-numbers",
2737
2757
  ref_key: "lineNumbersRef",
2738
- ref: Y
2758
+ ref: ee
2739
2759
  }, null, 512),
2740
2760
  e("pre", {
2741
- class: N(["artifactuse-panel__code-block", `language-${ae.value}`])
2761
+ class: I(["artifactuse-panel__code-block", `language-${me.value}`])
2742
2762
  }, [
2743
2763
  (a(), s("code", {
2744
2764
  ref_key: "codeRef",
2745
- ref: O,
2746
- key: y(o).id,
2747
- class: N(`language-${ae.value}`)
2765
+ ref: U,
2766
+ key: y(r).id,
2767
+ class: I(`language-${me.value}`)
2748
2768
  }, null, 2))
2749
2769
  ], 2)
2750
2770
  ], 544)
2751
2771
  ], 4), [
2752
- [rt, y(f).viewMode === "code" || y(f).viewMode === "split"]
2772
+ [ht, y(p).viewMode === "code" || y(p).viewMode === "split"]
2753
2773
  ]),
2754
- ot(e("div", fn, [
2774
+ _t(e("div", $n, [
2755
2775
  e("div", {
2756
2776
  ref_key: "editorContainerRef",
2757
- ref: ie,
2777
+ ref: re,
2758
2778
  class: "artifactuse-panel__editor-container"
2759
2779
  }, null, 512)
2760
2780
  ], 512), [
2761
- [rt, y(f).viewMode === "edit"]
2781
+ [ht, y(p).viewMode === "edit"]
2762
2782
  ])
2763
2783
  ], 2),
2764
- e("footer", pn, [
2765
- e("div", _n, [
2766
- G.value ? (a(), s("a", hn, [...t[40] || (t[40] = [
2784
+ $t.value ? (a(), s("div", {
2785
+ key: 1,
2786
+ class: I(["artifactuse-panel__console", { "artifactuse-panel__console--expanded": W.value }])
2787
+ }, [
2788
+ e("div", {
2789
+ class: "artifactuse-panel__console-header",
2790
+ onClick: t[14] || (t[14] = (u) => W.value = !W.value)
2791
+ }, [
2792
+ t[47] || (t[47] = e("svg", {
2793
+ class: "artifactuse-panel__console-chevron",
2794
+ viewBox: "0 0 24 24",
2795
+ fill: "none",
2796
+ stroke: "currentColor",
2797
+ "stroke-width": "2"
2798
+ }, [
2799
+ e("polyline", { points: "18 15 12 9 6 15" })
2800
+ ], -1)),
2801
+ t[48] || (t[48] = e("span", null, "Console", -1)),
2802
+ e("div", {
2803
+ class: "artifactuse-panel__console-filters",
2804
+ onClick: t[12] || (t[12] = _e(() => {
2805
+ }, ["stop"]))
2806
+ }, [
2807
+ Oe.value > 0 ? (a(), s("button", {
2808
+ key: 0,
2809
+ class: I(["artifactuse-panel__console-filter", "artifactuse-panel__console-filter--error", { "artifactuse-panel__console-filter--inactive": !w.value.has("error") }]),
2810
+ onClick: t[8] || (t[8] = (u) => He("error"))
2811
+ }, n(Oe.value) + " error" + n(Oe.value !== 1 ? "s" : ""), 3)) : v("", !0),
2812
+ Qe.value > 0 ? (a(), s("button", {
2813
+ key: 1,
2814
+ class: I(["artifactuse-panel__console-filter", "artifactuse-panel__console-filter--warn", { "artifactuse-panel__console-filter--inactive": !w.value.has("warn") }]),
2815
+ onClick: t[9] || (t[9] = (u) => He("warn"))
2816
+ }, n(Qe.value) + " warn", 3)) : v("", !0),
2817
+ Ge.value > 0 ? (a(), s("button", {
2818
+ key: 2,
2819
+ class: I(["artifactuse-panel__console-filter", "artifactuse-panel__console-filter--info", { "artifactuse-panel__console-filter--inactive": !w.value.has("info") }]),
2820
+ onClick: t[10] || (t[10] = (u) => He("info"))
2821
+ }, n(Ge.value) + " info", 3)) : v("", !0),
2822
+ et.value > 0 ? (a(), s("button", {
2823
+ key: 3,
2824
+ class: I(["artifactuse-panel__console-filter", "artifactuse-panel__console-filter--log", { "artifactuse-panel__console-filter--inactive": !w.value.has("log") }]),
2825
+ onClick: t[11] || (t[11] = (u) => He("log"))
2826
+ }, n(et.value) + " log", 3)) : v("", !0)
2827
+ ]),
2828
+ e("button", {
2829
+ class: "artifactuse-panel__console-clear",
2830
+ onClick: t[13] || (t[13] = _e((u) => Q.value = [], ["stop"]))
2831
+ }, "Clear")
2832
+ ]),
2833
+ W.value ? (a(), s("div", {
2834
+ key: 0,
2835
+ ref_key: "consoleEntriesEl",
2836
+ ref: ie,
2837
+ class: "artifactuse-panel__console-entries"
2838
+ }, [
2839
+ (a(!0), s(F, null, de(xt.value, (u, z) => (a(), s("div", {
2840
+ key: z,
2841
+ class: I("artifactuse-panel__console-entry artifactuse-panel__console-entry--" + u.type)
2842
+ }, [
2843
+ e("span", Mn, "[" + n(u.type) + "]", 1),
2844
+ e("span", Tn, n(u.content), 1),
2845
+ e("span", Ln, n(new Date(u.timestamp).toLocaleTimeString()), 1)
2846
+ ], 2))), 128))
2847
+ ], 512)) : v("", !0)
2848
+ ], 2)) : v("", !0),
2849
+ e("footer", Pn, [
2850
+ e("div", En, [
2851
+ qe.value ? (a(), s("a", An, [...t[49] || (t[49] = [
2767
2852
  e("svg", {
2768
2853
  width: "16",
2769
2854
  height: "16",
@@ -2782,17 +2867,17 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2782
2867
  ], -1),
2783
2868
  e("span", null, "Artifactuse", -1)
2784
2869
  ])])) : v("", !0),
2785
- y(o).size ? (a(), s("span", mn, l(y(dt)(y(o).size)), 1)) : v("", !0)
2870
+ y(r).size ? (a(), s("span", Hn, n(y(gt)(y(r).size)), 1)) : v("", !0)
2786
2871
  ]),
2787
- e("div", yn, [
2872
+ e("div", Bn, [
2788
2873
  e("button", {
2789
- class: N(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success": Z.value }]),
2790
- title: Z.value ? "Copied!" : "Copy code",
2791
- onClick: Tt
2874
+ class: I(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success": K.value }]),
2875
+ title: K.value ? "Copied!" : "Copy code",
2876
+ onClick: Rt
2792
2877
  }, [
2793
- Z.value ? (a(), s("svg", wn, [...t[42] || (t[42] = [
2878
+ K.value ? (a(), s("svg", Vn, [...t[51] || (t[51] = [
2794
2879
  e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
2795
- ])])) : (a(), s("svg", kn, [...t[41] || (t[41] = [
2880
+ ])])) : (a(), s("svg", zn, [...t[50] || (t[50] = [
2796
2881
  e("rect", {
2797
2882
  x: "9",
2798
2883
  y: "9",
@@ -2803,12 +2888,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2803
2888
  }, null, -1),
2804
2889
  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)
2805
2890
  ])]))
2806
- ], 10, gn),
2891
+ ], 10, Sn),
2807
2892
  e("button", {
2808
2893
  class: "artifactuse-panel__footer-action",
2809
2894
  title: "Download file",
2810
- onClick: Lt
2811
- }, [...t[43] || (t[43] = [
2895
+ onClick: qt
2896
+ }, [...t[52] || (t[52] = [
2812
2897
  e("svg", {
2813
2898
  viewBox: "0 0 24 24",
2814
2899
  fill: "none",
@@ -2825,12 +2910,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2825
2910
  })
2826
2911
  ], -1)
2827
2912
  ])]),
2828
- Me.value ? (a(), s("div", bn, [
2913
+ Mt.value ? (a(), s("div", In, [
2829
2914
  e("button", {
2830
2915
  class: "artifactuse-panel__footer-action",
2831
2916
  title: "Share",
2832
- onClick: At
2833
- }, [...t[44] || (t[44] = [
2917
+ onClick: Ut
2918
+ }, [...t[53] || (t[53] = [
2834
2919
  e("svg", {
2835
2920
  viewBox: "0 0 24 24",
2836
2921
  fill: "none",
@@ -2866,15 +2951,15 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2866
2951
  })
2867
2952
  ], -1)
2868
2953
  ])]),
2869
- ze(Ee, { name: "artifactuse-popup" }, {
2870
- default: Be(() => [
2871
- re.value ? (a(), s("div", Cn, [
2872
- e("div", xn, [
2873
- e("span", $n, l(P.value === "success" ? le.value ? "Artifact updated!" : "Link created!" : P.value === "update-list" ? "Update saved artifact" : "Share Artifact"), 1),
2954
+ Fe(ze, { name: "artifactuse-popup" }, {
2955
+ default: Ve(() => [
2956
+ E.value ? (a(), s("div", Fn, [
2957
+ e("div", Rn, [
2958
+ e("span", qn, n(i.value === "success" ? Le.value ? "Artifact updated!" : "Link created!" : i.value === "update-list" ? "Update saved artifact" : "Share Artifact"), 1),
2874
2959
  e("button", {
2875
2960
  class: "artifactuse-share-popup__close",
2876
- onClick: Ht
2877
- }, [...t[45] || (t[45] = [
2961
+ onClick: Dt
2962
+ }, [...t[54] || (t[54] = [
2878
2963
  e("svg", {
2879
2964
  viewBox: "0 0 24 24",
2880
2965
  fill: "none",
@@ -2896,29 +2981,29 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2896
2981
  ], -1)
2897
2982
  ])])
2898
2983
  ]),
2899
- e("div", Mn, [
2900
- P.value === "loading" ? (a(), s("div", Tn, [...t[46] || (t[46] = [
2984
+ e("div", On, [
2985
+ i.value === "loading" ? (a(), s("div", Un, [...t[55] || (t[55] = [
2901
2986
  e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
2902
2987
  e("p", { class: "artifactuse-share-popup__loading-text" }, "Creating link...", -1)
2903
- ])])) : P.value === "error" ? (a(), s("div", Ln, [
2904
- e("div", Pn, [
2905
- e("p", An, l(L.value), 1)
2988
+ ])])) : i.value === "error" ? (a(), s("div", Dn, [
2989
+ e("div", jn, [
2990
+ e("p", Nn, n(L.value), 1)
2906
2991
  ]),
2907
- e("div", Hn, [
2992
+ e("div", Wn, [
2908
2993
  e("button", {
2909
2994
  class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--secondary",
2910
- onClick: t[8] || (t[8] = (p) => P.value = "options")
2995
+ onClick: t[15] || (t[15] = (u) => i.value = "options")
2911
2996
  }, " Back "),
2912
2997
  e("button", {
2913
2998
  class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--primary",
2914
- onClick: Et
2999
+ onClick: jt
2915
3000
  }, " Retry ")
2916
3001
  ])
2917
- ])) : P.value === "options" ? (a(), s("div", En, [
3002
+ ])) : i.value === "options" ? (a(), s("div", Jn, [
2918
3003
  e("button", {
2919
3004
  class: "artifactuse-share-popup__option",
2920
- onClick: Qe
2921
- }, [...t[47] || (t[47] = [
3005
+ onClick: nt
3006
+ }, [...t[56] || (t[56] = [
2922
3007
  e("div", { class: "artifactuse-share-popup__option-icon" }, [
2923
3008
  e("svg", {
2924
3009
  viewBox: "0 0 24 24",
@@ -2937,8 +3022,8 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2937
3022
  ])]),
2938
3023
  e("button", {
2939
3024
  class: "artifactuse-share-popup__option",
2940
- onClick: Ge
2941
- }, [...t[48] || (t[48] = [
3025
+ onClick: ot
3026
+ }, [...t[57] || (t[57] = [
2942
3027
  e("div", { class: "artifactuse-share-popup__option-icon" }, [
2943
3028
  e("svg", {
2944
3029
  viewBox: "0 0 24 24",
@@ -2958,8 +3043,8 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2958
3043
  ])]),
2959
3044
  e("button", {
2960
3045
  class: "artifactuse-share-popup__option",
2961
- onClick: Bt
2962
- }, [...t[49] || (t[49] = [
3046
+ onClick: Nt
3047
+ }, [...t[58] || (t[58] = [
2963
3048
  e("div", { class: "artifactuse-share-popup__option-icon" }, [
2964
3049
  e("svg", {
2965
3050
  viewBox: "0 0 24 24",
@@ -2977,29 +3062,29 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
2977
3062
  e("p", { class: "artifactuse-share-popup__option-desc" }, "Replace an existing artifact")
2978
3063
  ], -1)
2979
3064
  ])])
2980
- ])) : P.value === "update-list" ? (a(), s("div", Bn, [
2981
- z.value ? (a(), s("div", Sn, [...t[50] || (t[50] = [
3065
+ ])) : i.value === "update-list" ? (a(), s("div", Xn, [
3066
+ be.value ? (a(), s("div", Zn, [...t[59] || (t[59] = [
2982
3067
  e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
2983
3068
  e("p", { class: "artifactuse-share-popup__loading-text" }, "Loading artifacts...", -1)
2984
- ])])) : u.value.length === 0 ? (a(), s("div", zn, " No saved artifacts of this type ")) : (a(), s("div", Vn, [
2985
- (a(!0), s(R, null, ve(u.value, (p) => {
2986
- var F, J, me;
3069
+ ])])) : we.value.length === 0 ? (a(), s("div", Kn, " No saved artifacts of this type ")) : (a(), s("div", Yn, [
3070
+ (a(!0), s(F, null, de(we.value, (u) => {
3071
+ var z, X, ye;
2987
3072
  return a(), s("button", {
2988
- key: ((F = p.project) == null ? void 0 : F.uuid) || p.id,
3073
+ key: ((z = u.project) == null ? void 0 : z.uuid) || u.id,
2989
3074
  class: "artifactuse-share-popup__artifact-item",
2990
- onClick: (ue) => St(p)
3075
+ onClick: (pe) => Wt(u)
2991
3076
  }, [
2992
- e("span", Fn, l(((J = p.project) == null ? void 0 : J.name) || "Untitled"), 1),
2993
- e("span", Rn, l(Ye((me = p.project) == null ? void 0 : me.created_at)), 1)
2994
- ], 8, In);
3077
+ e("span", Gn, n(((X = u.project) == null ? void 0 : X.name) || "Untitled"), 1),
3078
+ e("span", eo, n(it((ye = u.project) == null ? void 0 : ye.created_at)), 1)
3079
+ ], 8, Qn);
2995
3080
  }), 128))
2996
3081
  ])),
2997
3082
  e("button", {
2998
3083
  class: "artifactuse-share-popup__back-btn",
2999
- onClick: t[9] || (t[9] = (p) => P.value = "options")
3084
+ onClick: t[16] || (t[16] = (u) => i.value = "options")
3000
3085
  }, "Back")
3001
- ])) : P.value === "success" ? (a(), s("div", qn, [
3002
- t[53] || (t[53] = e("div", { class: "artifactuse-share-popup__success-icon" }, [
3086
+ ])) : i.value === "success" ? (a(), s("div", to, [
3087
+ t[62] || (t[62] = e("div", { class: "artifactuse-share-popup__success-icon" }, [
3003
3088
  e("svg", {
3004
3089
  viewBox: "0 0 24 24",
3005
3090
  fill: "none",
@@ -3009,21 +3094,21 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
3009
3094
  e("polyline", { points: "20 6 9 17 4 12" })
3010
3095
  ])
3011
3096
  ], -1)),
3012
- e("div", On, [
3097
+ e("div", ao, [
3013
3098
  e("input", {
3014
3099
  type: "text",
3015
3100
  class: "artifactuse-share-popup__link",
3016
- value: Q.value,
3101
+ value: H.value,
3017
3102
  readonly: "",
3018
- onClick: t[10] || (t[10] = (p) => p.target.select())
3019
- }, null, 8, Un),
3103
+ onClick: t[17] || (t[17] = (u) => u.target.select())
3104
+ }, null, 8, so),
3020
3105
  e("button", {
3021
- class: N(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied": r.value }]),
3022
- onClick: zt
3023
- }, l(r.value ? "Copied!" : "Copy"), 3)
3106
+ class: I(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied": se.value }]),
3107
+ onClick: Jt
3108
+ }, n(se.value ? "Copied!" : "Copy"), 3)
3024
3109
  ]),
3025
- w.value && !B.value ? (a(), s("div", Dn, [
3026
- t[51] || (t[51] = e("span", { class: "artifactuse-share-popup__expiry-icon" }, [
3110
+ d.value && !ce.value ? (a(), s("div", lo, [
3111
+ t[60] || (t[60] = e("span", { class: "artifactuse-share-popup__expiry-icon" }, [
3027
3112
  e("svg", {
3028
3113
  viewBox: "0 0 24 24",
3029
3114
  fill: "none",
@@ -3049,18 +3134,18 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
3049
3134
  })
3050
3135
  ])
3051
3136
  ], -1)),
3052
- e("span", jn, " Expires " + l(Ye(w.value)), 1)
3137
+ e("span", io, " Expires " + n(it(d.value)), 1)
3053
3138
  ])) : v("", !0),
3054
- B.value ? v("", !0) : (a(), s("div", Nn, [
3055
- t[52] || (t[52] = e("p", { class: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?", -1)),
3139
+ ce.value ? v("", !0) : (a(), s("div", no, [
3140
+ t[61] || (t[61] = e("p", { class: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?", -1)),
3056
3141
  e("button", {
3057
3142
  class: "artifactuse-share-popup__save-prompt-btn",
3058
- onClick: Ge
3143
+ onClick: ot
3059
3144
  }, " Save to account ")
3060
3145
  ]))
3061
3146
  ])) : v("", !0)
3062
3147
  ]),
3063
- t[54] || (t[54] = e("div", { class: "artifactuse-share-popup__footer" }, [
3148
+ t[63] || (t[63] = e("div", { class: "artifactuse-share-popup__footer" }, [
3064
3149
  e("a", {
3065
3150
  href: "https://artifactuse.com",
3066
3151
  target: "_blank",
@@ -3091,12 +3176,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
3091
3176
  _: 1
3092
3177
  })
3093
3178
  ])) : v("", !0),
3094
- A.value ? (a(), s("button", {
3179
+ G.value ? (a(), s("button", {
3095
3180
  key: 1,
3096
3181
  class: "artifactuse-panel__footer-action",
3097
3182
  title: "Open in new tab",
3098
- onClick: et
3099
- }, [...t[55] || (t[55] = [
3183
+ onClick: rt
3184
+ }, [...t[64] || (t[64] = [
3100
3185
  e("svg", {
3101
3186
  viewBox: "0 0 24 24",
3102
3187
  fill: "none",
@@ -3113,13 +3198,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
3113
3198
  })
3114
3199
  ], -1)
3115
3200
  ])])) : v("", !0),
3116
- !Te.value && d.value.length > 1 ? (a(), s("div", Wn, [
3201
+ !Ee.value && fe.value.length > 1 ? (a(), s("div", oo, [
3117
3202
  e("button", {
3118
3203
  class: "artifactuse-panel__nav-btn",
3119
- disabled: U.value <= 0,
3204
+ disabled: Pe.value <= 0,
3120
3205
  title: "Previous artifact",
3121
- onClick: Ft
3122
- }, [...t[56] || (t[56] = [
3206
+ onClick: Kt
3207
+ }, [...t[65] || (t[65] = [
3123
3208
  e("svg", {
3124
3209
  viewBox: "0 0 24 24",
3125
3210
  fill: "none",
@@ -3128,14 +3213,14 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
3128
3213
  }, [
3129
3214
  e("polyline", { points: "15 18 9 12 15 6" })
3130
3215
  ], -1)
3131
- ])], 8, Jn),
3216
+ ])], 8, ro),
3132
3217
  e("button", {
3133
3218
  class: "artifactuse-panel__nav-trigger",
3134
3219
  title: "View all artifacts",
3135
- onClick: It
3220
+ onClick: Zt
3136
3221
  }, [
3137
- e("span", null, l(U.value + 1) + " / " + l(d.value.length), 1),
3138
- t[57] || (t[57] = e("svg", {
3222
+ e("span", null, n(Pe.value + 1) + " / " + n(fe.value.length), 1),
3223
+ t[66] || (t[66] = e("svg", {
3139
3224
  viewBox: "0 0 24 24",
3140
3225
  fill: "none",
3141
3226
  stroke: "currentColor",
@@ -3146,10 +3231,10 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
3146
3231
  ]),
3147
3232
  e("button", {
3148
3233
  class: "artifactuse-panel__nav-btn",
3149
- disabled: U.value >= d.value.length - 1,
3234
+ disabled: Pe.value >= fe.value.length - 1,
3150
3235
  title: "Next artifact",
3151
- onClick: Rt
3152
- }, [...t[58] || (t[58] = [
3236
+ onClick: Yt
3237
+ }, [...t[67] || (t[67] = [
3153
3238
  e("svg", {
3154
3239
  viewBox: "0 0 24 24",
3155
3240
  fill: "none",
@@ -3158,16 +3243,16 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
3158
3243
  }, [
3159
3244
  e("polyline", { points: "9 18 15 12 9 6" })
3160
3245
  ], -1)
3161
- ])], 8, Xn),
3162
- ze(Ee, { name: "artifactuse-popup" }, {
3163
- default: Be(() => [
3164
- X.value ? (a(), s("div", Zn, [
3165
- e("div", Kn, [
3166
- t[60] || (t[60] = e("span", null, "Artifacts", -1)),
3246
+ ])], 8, co),
3247
+ Fe(ze, { name: "artifactuse-popup" }, {
3248
+ default: Ve(() => [
3249
+ Z.value ? (a(), s("div", uo, [
3250
+ e("div", vo, [
3251
+ t[69] || (t[69] = e("span", null, "Artifacts", -1)),
3167
3252
  e("button", {
3168
3253
  class: "artifactuse-panel__artifact-list-close",
3169
- onClick: t[11] || (t[11] = (p) => X.value = !1)
3170
- }, [...t[59] || (t[59] = [
3254
+ onClick: t[18] || (t[18] = (u) => Z.value = !1)
3255
+ }, [...t[68] || (t[68] = [
3171
3256
  e("svg", {
3172
3257
  viewBox: "0 0 24 24",
3173
3258
  fill: "none",
@@ -3189,27 +3274,27 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
3189
3274
  ], -1)
3190
3275
  ])])
3191
3276
  ]),
3192
- e("div", Yn, [
3193
- (a(!0), s(R, null, ve(d.value, (p, F) => (a(), s("button", {
3194
- key: p.id,
3195
- class: N(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": p.id === y(o).id }]),
3196
- onClick: (J) => tt(p)
3277
+ e("div", fo, [
3278
+ (a(!0), s(F, null, de(fe.value, (u, z) => (a(), s("button", {
3279
+ key: u.id,
3280
+ class: I(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": u.id === y(r).id }]),
3281
+ onClick: (X) => ct(u)
3197
3282
  }, [
3198
3283
  e("span", {
3199
3284
  class: "artifactuse-panel__artifact-item-icon",
3200
- innerHTML: Ie(p.language)
3201
- }, null, 8, Gn),
3202
- e("div", eo, [
3203
- e("span", to, l(p.title || "Untitled"), 1),
3204
- e("span", ao, [
3205
- K(l(y(Se)(p.language)) + " ", 1),
3206
- p.lineCount ? (a(), s(R, { key: 0 }, [
3207
- K(" • " + l(p.lineCount) + " lines ", 1)
3285
+ innerHTML: Ue(u.language)
3286
+ }, null, 8, _o),
3287
+ e("div", ho, [
3288
+ e("span", mo, n(u.title || "Untitled"), 1),
3289
+ e("span", yo, [
3290
+ Y(n(y(Ie)(u.language)) + " ", 1),
3291
+ u.lineCount ? (a(), s(F, { key: 0 }, [
3292
+ Y(" • " + n(u.lineCount) + " lines ", 1)
3208
3293
  ], 64)) : v("", !0)
3209
3294
  ])
3210
3295
  ]),
3211
- e("span", so, l(F + 1), 1)
3212
- ], 10, Qn))), 128))
3296
+ e("span", go, n(z + 1), 1)
3297
+ ], 10, po))), 128))
3213
3298
  ])
3214
3299
  ])) : v("", !0)
3215
3300
  ]),
@@ -3224,19 +3309,19 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
3224
3309
  _: 1
3225
3310
  }));
3226
3311
  }
3227
- }, io = ["title"], lo = {
3312
+ }, ko = ["title"], wo = {
3228
3313
  key: 0,
3229
3314
  class: "artifactuse-panel-toggle-badge"
3230
- }, fo = {
3315
+ }, Lo = {
3231
3316
  __name: "ArtifactusePanelToggle",
3232
- setup(H) {
3233
- const { state: c, artifactCount: _, hasArtifacts: M, togglePanel: f } = Ve();
3234
- return (o, q) => (a(), s("button", {
3235
- class: N(["artifactuse-panel-toggle", {
3317
+ setup(P) {
3318
+ const { state: c, artifactCount: _, hasArtifacts: T, togglePanel: p } = Re();
3319
+ return (r, q) => (a(), s("button", {
3320
+ class: I(["artifactuse-panel-toggle", {
3236
3321
  "artifactuse-panel-toggle--active": y(c).isPanelOpen,
3237
- "artifactuse-panel-toggle--has-artifacts": y(M)
3322
+ "artifactuse-panel-toggle--has-artifacts": y(T)
3238
3323
  }]),
3239
- onClick: q[0] || (q[0] = (...E) => y(f) && y(f)(...E)),
3324
+ onClick: q[0] || (q[0] = (...A) => y(p) && y(p)(...A)),
3240
3325
  title: y(c).isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
3241
3326
  }, [
3242
3327
  q[1] || (q[1] = e("svg", {
@@ -3250,13 +3335,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
3250
3335
  e("polyline", { points: "16 18 22 12 16 6" }),
3251
3336
  e("polyline", { points: "8 6 2 12 8 18" })
3252
3337
  ], -1)),
3253
- y(_) > 0 ? (a(), s("span", lo, l(y(_) > 99 ? "99+" : y(_)), 1)) : v("", !0)
3254
- ], 10, io));
3338
+ y(_) > 0 ? (a(), s("span", wo, n(y(_) > 99 ? "99+" : y(_)), 1)) : v("", !0)
3339
+ ], 10, ko));
3255
3340
  }
3256
- }, ft = Symbol("artifactuse");
3257
- function pt(H = {}) {
3258
- var n;
3259
- const c = vt(H), _ = ut({
3341
+ }, wt = Symbol("artifactuse");
3342
+ function bt(P = {}) {
3343
+ var o;
3344
+ const c = kt(P), _ = yt({
3260
3345
  artifacts: [],
3261
3346
  activeArtifactId: null,
3262
3347
  isPanelOpen: !1,
@@ -3269,9 +3354,9 @@ function pt(H = {}) {
3269
3354
  c.state.subscribe((h) => {
3270
3355
  _.artifacts = h.artifacts, _.activeArtifactId = h.activeArtifactId, _.isPanelOpen = h.isPanelOpen, _.viewMode = h.viewMode, _.isFullscreen = h.isFullscreen, _.openTabs = h.openTabs, _.tabViewModes = h.tabViewModes, _.forceEmptyView = h.forceEmptyView;
3271
3356
  });
3272
- const M = C(() => _.activeArtifactId && _.artifacts.find((h) => h.id === _.activeArtifactId) || null), f = C(() => _.artifacts.filter((h) => !h.isInline).length), o = C(() => _.artifacts.some((h) => !h.isInline)), q = C(() => c.getPanelTypes()), E = C(() => M.value ? c.getPanelUrl(M.value) : null);
3273
- if (c.applyTheme(), H.theme === "auto" || !H.theme) {
3274
- const h = ((n = c.bridge) == null ? void 0 : n.theme) || c.theme;
3357
+ const T = b(() => _.activeArtifactId && _.artifacts.find((h) => h.id === _.activeArtifactId) || null), p = b(() => _.artifacts.filter((h) => !h.isInline).length), r = b(() => _.artifacts.some((h) => !h.isInline)), q = b(() => c.getPanelTypes()), A = b(() => T.value ? c.getPanelUrl(T.value) : null);
3358
+ if (c.applyTheme(), P.theme === "auto" || !P.theme) {
3359
+ const h = ((o = c.bridge) == null ? void 0 : o.theme) || c.theme;
3275
3360
  h != null && h.watchSystemTheme && h.watchSystemTheme(() => {
3276
3361
  c.applyTheme();
3277
3362
  });
@@ -3279,12 +3364,12 @@ function pt(H = {}) {
3279
3364
  const g = {
3280
3365
  instance: c,
3281
3366
  state: _,
3282
- activeArtifact: M,
3283
- artifactCount: f,
3284
- hasArtifacts: o,
3367
+ activeArtifact: T,
3368
+ artifactCount: p,
3369
+ hasArtifacts: r,
3285
3370
  // Panel computed
3286
3371
  panelTypes: q,
3287
- activePanelUrl: E,
3372
+ activePanelUrl: A,
3288
3373
  // Methods
3289
3374
  processMessage: c.processMessage,
3290
3375
  initializeContent: c.initializeContent,
@@ -3320,14 +3405,14 @@ function pt(H = {}) {
3320
3405
  },
3321
3406
  getTheme: c.getTheme
3322
3407
  };
3323
- return Jt(ft, g), g;
3408
+ return ia(wt, g), g;
3324
3409
  }
3325
- function Ve() {
3326
- const H = Xt(ft);
3327
- return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), pt());
3410
+ function Re() {
3411
+ const P = na(wt);
3412
+ return P || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), bt());
3328
3413
  }
3329
- function no(H = {}) {
3330
- const c = vt(H), _ = ut({
3414
+ function bo(P = {}) {
3415
+ const c = kt(P), _ = yt({
3331
3416
  artifacts: [],
3332
3417
  activeArtifactId: null,
3333
3418
  isPanelOpen: !1,
@@ -3337,23 +3422,23 @@ function no(H = {}) {
3337
3422
  tabViewModes: {},
3338
3423
  forceEmptyView: !1
3339
3424
  });
3340
- let M;
3341
- $e(() => {
3342
- M = c.state.subscribe((n) => {
3343
- _.artifacts = n.artifacts, _.activeArtifactId = n.activeArtifactId, _.isPanelOpen = n.isPanelOpen, _.viewMode = n.viewMode, _.isFullscreen = n.isFullscreen, _.openTabs = n.openTabs, _.tabViewModes = n.tabViewModes, _.forceEmptyView = n.forceEmptyView;
3425
+ let T;
3426
+ Te(() => {
3427
+ T = c.state.subscribe((o) => {
3428
+ _.artifacts = o.artifacts, _.activeArtifactId = o.activeArtifactId, _.isPanelOpen = o.isPanelOpen, _.viewMode = o.viewMode, _.isFullscreen = o.isFullscreen, _.openTabs = o.openTabs, _.tabViewModes = o.tabViewModes, _.forceEmptyView = o.forceEmptyView;
3344
3429
  }), c.applyTheme();
3345
- }), We(() => {
3346
- M && M(), c.destroy();
3430
+ }), Ye(() => {
3431
+ T && T(), c.destroy();
3347
3432
  });
3348
- const f = C(() => _.activeArtifactId && _.artifacts.find((n) => n.id === _.activeArtifactId) || null), o = C(() => _.artifacts.filter((n) => !n.isInline).length), q = C(() => _.artifacts.some((n) => !n.isInline)), E = C(() => c.getPanelTypes()), g = C(() => f.value ? c.getPanelUrl(f.value) : null);
3433
+ const p = b(() => _.activeArtifactId && _.artifacts.find((o) => o.id === _.activeArtifactId) || null), r = b(() => _.artifacts.filter((o) => !o.isInline).length), q = b(() => _.artifacts.some((o) => !o.isInline)), A = b(() => c.getPanelTypes()), g = b(() => p.value ? c.getPanelUrl(p.value) : null);
3349
3434
  return {
3350
3435
  instance: c,
3351
3436
  state: _,
3352
- activeArtifact: f,
3353
- artifactCount: o,
3437
+ activeArtifact: p,
3438
+ artifactCount: r,
3354
3439
  hasArtifacts: q,
3355
3440
  // Panel computed
3356
- panelTypes: E,
3441
+ panelTypes: A,
3357
3442
  activePanelUrl: g,
3358
3443
  // Methods
3359
3444
  processMessage: c.processMessage,
@@ -3385,29 +3470,29 @@ function no(H = {}) {
3385
3470
  clearArtifacts: () => c.state.clear(),
3386
3471
  // Theme - wrap setTheme to also apply
3387
3472
  applyTheme: c.applyTheme,
3388
- setTheme: (n) => {
3389
- c.setTheme(n), c.applyTheme();
3473
+ setTheme: (o) => {
3474
+ c.setTheme(o), c.applyTheme();
3390
3475
  },
3391
3476
  getTheme: c.getTheme
3392
3477
  };
3393
3478
  }
3394
- const po = {
3395
- provideArtifactuse: pt,
3396
- useArtifactuse: Ve,
3397
- createArtifactuseComposable: no,
3398
- DEFAULT_PANELS: Yt
3479
+ const Po = {
3480
+ provideArtifactuse: bt,
3481
+ useArtifactuse: Re,
3482
+ createArtifactuseComposable: bo,
3483
+ DEFAULT_PANELS: ca
3399
3484
  };
3400
3485
  export {
3401
- uo as ArtifactuseAgentMessage,
3402
- ua as ArtifactuseCard,
3403
- Ga as ArtifactuseInlineForm,
3404
- vo as ArtifactusePanel,
3405
- fo as ArtifactusePanelToggle,
3406
- al as ArtifactuseSocialPreview,
3407
- ul as ArtifactuseViewer,
3408
- Yt as DEFAULT_PANELS,
3409
- no as createArtifactuseComposable,
3410
- po as default,
3411
- pt as provideArtifactuse,
3412
- Ve as useArtifactuse
3486
+ Mo as ArtifactuseAgentMessage,
3487
+ ba as ArtifactuseCard,
3488
+ ds as ArtifactuseInlineForm,
3489
+ To as ArtifactusePanel,
3490
+ Lo as ArtifactusePanelToggle,
3491
+ pi as ArtifactuseSocialPreview,
3492
+ bi as ArtifactuseViewer,
3493
+ ca as DEFAULT_PANELS,
3494
+ bo as createArtifactuseComposable,
3495
+ Po as default,
3496
+ bt as provideArtifactuse,
3497
+ Re as useArtifactuse
3413
3498
  };