artifactuse 0.1.30 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +1,49 @@
1
- import e, { useState as b, useMemo as T, useCallback as d, useRef as W, useEffect as j, createContext as Bt, useContext as Ft } from "react";
2
- import { g as ze, f as Et, a as et, b as tt, n as Wt, i as dt, c as Vt, D as vt, d as zt } from "../index-BH35XKmt.js";
3
- import { J as Rt } from "../jszip.min-CdmYyw5L.js";
4
- import { createPortal as qt } from "react-dom";
5
- function Dt({
1
+ import e, { useState as w, useMemo as C, useCallback as p, useRef as B, useEffect as z, createContext as Vt, useContext as zt } from "react";
2
+ import { g as Ue, f as ht, a as at, b as rt, n as Rt, i as pt, c as qt, D as gt, d as Dt } from "../index-INYOxlcg.js";
3
+ import { J as Ut } from "../jszip.min-CdmYyw5L.js";
4
+ import { createPortal as jt } from "react-dom";
5
+ function Ot({
6
6
  artifact: t,
7
7
  isActive: a = !1,
8
- onOpen: c,
9
- onCopy: l,
10
- onDownload: s,
11
- className: r = ""
8
+ onOpen: l,
9
+ onCopy: n,
10
+ onDownload: i,
11
+ className: m = ""
12
12
  }) {
13
- const [v, p] = b(!1), x = T(() => ze(t.language), [t.language]), i = T(() => {
14
- var C;
15
- return Et(t.size || ((C = t.code) == null ? void 0 : C.length) || 0);
16
- }, [t.size, t.code]), k = T(() => et(t.language), [t.language]), S = d((C) => {
17
- C.stopPropagation(), c && c(t);
18
- }, [t, c]), L = d(async (C) => {
19
- C.stopPropagation();
13
+ const [u, r] = w(!1), x = C(() => Ue(t.language), [t.language]), o = C(() => {
14
+ var c;
15
+ return ht(t.size || ((c = t.code) == null ? void 0 : c.length) || 0);
16
+ }, [t.size, t.code]), k = C(() => at(t.language), [t.language]), M = p((c) => {
17
+ c.stopPropagation(), l && l(t);
18
+ }, [t, l]), T = p(async (c) => {
19
+ c.stopPropagation();
20
20
  try {
21
- await navigator.clipboard.writeText(t.code), p(!0), l && l(t), setTimeout(() => {
22
- p(!1);
21
+ await navigator.clipboard.writeText(t.code), r(!0), n && n(t), setTimeout(() => {
22
+ r(!1);
23
23
  }, 2e3);
24
24
  } catch {
25
25
  const g = document.createElement("textarea");
26
26
  g.value = t.code, g.style.position = "fixed", g.style.opacity = "0", document.body.appendChild(g), g.select();
27
27
  try {
28
- document.execCommand("copy"), p(!0), l && l(t), setTimeout(() => {
29
- p(!1);
28
+ document.execCommand("copy"), r(!0), n && n(t), setTimeout(() => {
29
+ r(!1);
30
30
  }, 2e3);
31
- } catch (z) {
32
- console.error("Failed to copy:", z);
31
+ } catch (D) {
32
+ console.error("Failed to copy:", D);
33
33
  }
34
34
  document.body.removeChild(g);
35
35
  }
36
- }, [t, l]), u = d((C) => {
37
- var R;
38
- C.stopPropagation();
39
- const f = new Blob([t.code], { type: "text/plain" }), g = URL.createObjectURL(f), z = document.createElement("a"), se = tt(t.language), M = ((R = t.title) == null ? void 0 : R.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
40
- z.href = g, z.download = `${M}.${se}`, document.body.appendChild(z), z.click(), document.body.removeChild(z), URL.revokeObjectURL(g), s && s(t);
41
- }, [t, s]), h = [
36
+ }, [t, n]), $ = p((c) => {
37
+ var q;
38
+ c.stopPropagation();
39
+ const E = new Blob([t.code], { type: "text/plain" }), g = URL.createObjectURL(E), D = document.createElement("a"), J = rt(t.language), S = ((q = t.title) == null ? void 0 : q.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
40
+ D.href = g, D.download = `${S}.${J}`, document.body.appendChild(D), D.click(), document.body.removeChild(D), URL.revokeObjectURL(g), i && i(t);
41
+ }, [t, i]), h = [
42
42
  "artifactuse-card",
43
43
  a && "artifactuse-card--active",
44
- r
44
+ m
45
45
  ].filter(Boolean).join(" ");
46
- return /* @__PURE__ */ e.createElement("div", { className: h, onClick: S }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-card__icon" }, /* @__PURE__ */ e.createElement(
46
+ return /* @__PURE__ */ e.createElement("div", { className: h, onClick: M }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-card__icon" }, /* @__PURE__ */ e.createElement(
47
47
  "svg",
48
48
  {
49
49
  viewBox: "0 0 24 24",
@@ -52,233 +52,233 @@ function Dt({
52
52
  strokeWidth: "1.5",
53
53
  dangerouslySetInnerHTML: { __html: k }
54
54
  }
55
- )), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-card__content" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-card__title" }, t.title), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-card__meta" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-card__type" }, x), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-card__separator" }, "•"), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-card__size" }, i))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-card__actions" }, /* @__PURE__ */ e.createElement(
55
+ )), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-card__content" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-card__title" }, t.title), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-card__meta" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-card__type" }, x), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-card__separator" }, "•"), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-card__size" }, o))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-card__actions" }, /* @__PURE__ */ e.createElement(
56
56
  "button",
57
57
  {
58
58
  className: "artifactuse-card__action",
59
- title: v ? "Copied!" : "Copy code",
60
- onClick: L
59
+ title: u ? "Copied!" : "Copy code",
60
+ onClick: T
61
61
  },
62
- v ? /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "20 6 9 17 4 12" })) : /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }), /* @__PURE__ */ e.createElement("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }))
62
+ u ? /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "20 6 9 17 4 12" })) : /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }), /* @__PURE__ */ e.createElement("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }))
63
63
  ), /* @__PURE__ */ e.createElement(
64
64
  "button",
65
65
  {
66
66
  className: "artifactuse-card__action",
67
67
  title: "Download file",
68
- onClick: u
68
+ onClick: $
69
69
  },
70
70
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), /* @__PURE__ */ e.createElement("polyline", { points: "7 10 12 15 17 10" }), /* @__PURE__ */ e.createElement("line", { x1: "12", y1: "15", x2: "12", y2: "3" }))
71
71
  )), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-card__arrow" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "9 18 15 12 9 6" }))));
72
72
  }
73
- function Ut(t) {
73
+ function Jt(t) {
74
74
  if (!t) return null;
75
75
  const a = t.trim();
76
76
  if (a.startsWith("#")) {
77
- let s = a.slice(1);
78
- if (s.length === 3 && (s = s.split("").map((r) => r + r).join("")), s.length === 6) {
79
- const r = parseInt(s.slice(0, 2), 16), v = parseInt(s.slice(2, 4), 16), p = parseInt(s.slice(4, 6), 16);
80
- if (!isNaN(r) && !isNaN(v) && !isNaN(p)) return `${r}, ${v}, ${p}`;
77
+ let i = a.slice(1);
78
+ if (i.length === 3 && (i = i.split("").map((m) => m + m).join("")), i.length === 6) {
79
+ const m = parseInt(i.slice(0, 2), 16), u = parseInt(i.slice(2, 4), 16), r = parseInt(i.slice(4, 6), 16);
80
+ if (!isNaN(m) && !isNaN(u) && !isNaN(r)) return `${m}, ${u}, ${r}`;
81
81
  }
82
82
  }
83
- const c = a.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
84
- if (c) return `${c[1]}, ${c[2]}, ${c[3]}`;
85
- const l = a.split(/[\s,]+/).map(Number).filter((s) => !isNaN(s));
86
- return l.length >= 3 ? `${l[0]}, ${l[1]}, ${l[2]}` : null;
83
+ const l = a.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
84
+ if (l) return `${l[1]}, ${l[2]}, ${l[3]}`;
85
+ const n = a.split(/[\s,]+/).map(Number).filter((i) => !isNaN(i));
86
+ return n.length >= 3 ? `${n[0]}, ${n[1]}, ${n[2]}` : null;
87
87
  }
88
- function ft(t) {
88
+ function Et(t) {
89
89
  return t ? t.map((a) => typeof a == "string" ? { label: a, value: a } : a) : [];
90
90
  }
91
- function jt(t) {
91
+ function Xt(t) {
92
92
  return ["text", "email", "password", "tel", "url", "number", "date", "time", "datetime-local"].includes(t);
93
93
  }
94
- function Ot({
94
+ function Zt({
95
95
  artifact: t,
96
96
  onSubmit: a,
97
- onCancel: c,
98
- onReset: l,
99
- onButtonClick: s,
100
- className: r = "",
101
- theme: v = "dark",
102
- accent: p = null,
97
+ onCancel: l,
98
+ onReset: n,
99
+ onButtonClick: i,
100
+ className: m = "",
101
+ theme: u = "dark",
102
+ accent: r = null,
103
103
  initialState: x = "active"
104
104
  // 'active' | 'submitted' | 'cancelled' | 'inactive'
105
105
  }) {
106
- var ie, ne, oe;
107
- const i = W(null), [k, S] = b(x), L = k !== "active", u = k === "active" ? "" : `artifactuse-form--${k}`, h = T(() => {
106
+ var ne, Q, Ee;
107
+ const o = B(null), [k, M] = w(x), T = k !== "active", $ = k === "active" ? "" : `artifactuse-form--${k}`, h = C(() => {
108
108
  try {
109
109
  return JSON.parse(t.code);
110
110
  } catch {
111
111
  return { title: "Invalid Form", variant: "fields", data: { fields: [] } };
112
112
  }
113
- }, [t.code]), C = t.id || h.id || `form-${Date.now()}`, f = ((ie = h.data) == null ? void 0 : ie.fields) || [], g = h.title || "Form", z = T(() => f.some((o) => o.type === "buttons"), [f]), se = T(() => h.variant === "buttons" ? f : [], [h.variant, f]), [M, R] = b(() => {
114
- var _;
115
- const o = {};
116
- return f.forEach((y) => {
117
- ["buttons", "divider", "heading"].includes(y.type) || (y.defaultValue !== void 0 ? o[y.name] = y.defaultValue : y.type === "checkbox" ? o[y.name] = !1 : o[y.name] = "");
118
- }), (_ = h.data) != null && _.defaults && Object.assign(o, h.data.defaults), o;
119
- }), [le, q] = b({}), [ee, $] = b(!1);
120
- j(() => {
121
- S(x);
122
- }, [x]), j(() => {
123
- var _;
124
- const o = {};
125
- f.forEach((y) => {
126
- ["buttons", "divider", "heading"].includes(y.type) || (y.defaultValue !== void 0 ? o[y.name] = y.defaultValue : y.type === "checkbox" ? o[y.name] = !1 : o[y.name] = "");
127
- }), (_ = h.data) != null && _.defaults && Object.assign(o, h.data.defaults), R(o), q({});
128
- }, [t.code]), j(() => {
129
- if (i.current && (i.current.setAttribute("data-artifactuse-theme", v), p)) {
130
- const o = Ut(p);
131
- o && i.current.style.setProperty("--artifactuse-primary", o);
113
+ }, [t.code]), c = t.id || h.id || `form-${Date.now()}`, E = ((ne = h.data) == null ? void 0 : ne.fields) || [], g = h.title || "Form", D = C(() => E.some((d) => d.type === "buttons"), [E]), J = C(() => h.variant === "buttons" ? E : [], [h.variant, E]), [S, q] = w(() => {
114
+ var L;
115
+ const d = {};
116
+ return E.forEach((y) => {
117
+ ["buttons", "divider", "heading"].includes(y.type) || (y.defaultValue !== void 0 ? d[y.name] = y.defaultValue : y.type === "checkbox" ? d[y.name] = !1 : d[y.name] = "");
118
+ }), (L = h.data) != null && L.defaults && Object.assign(d, h.data.defaults), d;
119
+ }), [U, R] = w({}), [ae, A] = w(!1);
120
+ z(() => {
121
+ M(x);
122
+ }, [x]), z(() => {
123
+ var L;
124
+ const d = {};
125
+ E.forEach((y) => {
126
+ ["buttons", "divider", "heading"].includes(y.type) || (y.defaultValue !== void 0 ? d[y.name] = y.defaultValue : y.type === "checkbox" ? d[y.name] = !1 : d[y.name] = "");
127
+ }), (L = h.data) != null && L.defaults && Object.assign(d, h.data.defaults), q(d), R({});
128
+ }, [t.code]), z(() => {
129
+ if (o.current && (o.current.setAttribute("data-artifactuse-theme", u), r)) {
130
+ const d = Jt(r);
131
+ d && o.current.style.setProperty("--artifactuse-primary", d);
132
132
  }
133
- }, [v, p]);
134
- const D = d((o) => {
135
- S(o);
136
- }, []), de = d((o, _) => {
137
- R((y) => ({ ...y, [o]: _ })), q((y) => {
138
- const w = { ...y };
139
- return delete w[o], w;
133
+ }, [u, r]);
134
+ const j = p((d) => {
135
+ M(d);
136
+ }, []), me = p((d, L) => {
137
+ q((y) => ({ ...y, [d]: L })), R((y) => {
138
+ const v = { ...y };
139
+ return delete v[d], v;
140
140
  });
141
- }, []), ce = d(() => {
141
+ }, []), re = p(() => {
142
142
  var y;
143
- const o = {};
144
- f.forEach((w) => {
145
- if (["buttons", "divider", "heading"].includes(w.type)) return;
146
- const H = M[w.name];
147
- if (w.required && !H && H !== 0 && H !== !1) {
148
- o[w.name] = `${w.label || "This field"} is required`;
143
+ const d = {};
144
+ E.forEach((v) => {
145
+ if (["buttons", "divider", "heading"].includes(v.type)) return;
146
+ const P = S[v.name];
147
+ if (v.required && !P && P !== 0 && P !== !1) {
148
+ d[v.name] = `${v.label || "This field"} is required`;
149
149
  return;
150
150
  }
151
- if (w.pattern && H && !new RegExp(w.pattern).test(H)) {
152
- o[w.name] = w.patternMessage || `${w.label || "This field"} is invalid`;
151
+ if (v.pattern && P && !new RegExp(v.pattern).test(P)) {
152
+ d[v.name] = v.patternMessage || `${v.label || "This field"} is invalid`;
153
153
  return;
154
154
  }
155
- if (w.type === "email" && H && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(H)) {
156
- o[w.name] = "Please enter a valid email address";
155
+ if (v.type === "email" && P && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(P)) {
156
+ d[v.name] = "Please enter a valid email address";
157
157
  return;
158
158
  }
159
- if (w.minLength && H && H.length < w.minLength) {
160
- o[w.name] = `Minimum ${w.minLength} characters required`;
159
+ if (v.minLength && P && P.length < v.minLength) {
160
+ d[v.name] = `Minimum ${v.minLength} characters required`;
161
161
  return;
162
162
  }
163
- if (w.maxLength && H && H.length > w.maxLength) {
164
- o[w.name] = `Maximum ${w.maxLength} characters allowed`;
163
+ if (v.maxLength && P && P.length > v.maxLength) {
164
+ d[v.name] = `Maximum ${v.maxLength} characters allowed`;
165
165
  return;
166
166
  }
167
167
  });
168
- const _ = (y = h.data) == null ? void 0 : y.validation;
169
- return _ && Object.entries(_).forEach(([w, H]) => {
170
- if (o[w]) return;
171
- const ae = M[w];
172
- H.pattern && ae && (new RegExp(H.pattern).test(ae) || (o[w] = H.message || `${w} is invalid`));
173
- }), q(o), Object.keys(o).length === 0;
174
- }, [f, M, (ne = h.data) == null ? void 0 : ne.validation]), ge = d(() => {
175
- var _;
176
- const o = {};
177
- f.forEach((y) => {
178
- ["buttons", "divider", "heading"].includes(y.type) || (y.defaultValue !== void 0 ? o[y.name] = y.defaultValue : y.type === "checkbox" ? o[y.name] = !1 : o[y.name] = "");
179
- }), (_ = h.data) != null && _.defaults && Object.assign(o, h.data.defaults), R(o), q({});
180
- }, [f, (oe = h.data) == null ? void 0 : oe.defaults]), fe = d((o) => {
181
- o == null || o.preventDefault(), ce() && ($(!0), a == null || a({
182
- formId: C,
168
+ const L = (y = h.data) == null ? void 0 : y.validation;
169
+ return L && Object.entries(L).forEach(([v, P]) => {
170
+ if (d[v]) return;
171
+ const G = S[v];
172
+ P.pattern && G && (new RegExp(P.pattern).test(G) || (d[v] = P.message || `${v} is invalid`));
173
+ }), R(d), Object.keys(d).length === 0;
174
+ }, [E, S, (Q = h.data) == null ? void 0 : Q.validation]), de = p(() => {
175
+ var L;
176
+ const d = {};
177
+ E.forEach((y) => {
178
+ ["buttons", "divider", "heading"].includes(y.type) || (y.defaultValue !== void 0 ? d[y.name] = y.defaultValue : y.type === "checkbox" ? d[y.name] = !1 : d[y.name] = "");
179
+ }), (L = h.data) != null && L.defaults && Object.assign(d, h.data.defaults), q(d), R({});
180
+ }, [E, (Ee = h.data) == null ? void 0 : Ee.defaults]), fe = p((d) => {
181
+ d == null || d.preventDefault(), re() && (A(!0), a == null || a({
182
+ formId: c,
183
183
  action: "submit",
184
- values: { ...M },
184
+ values: { ...S },
185
185
  timestamp: Date.now()
186
186
  }), setTimeout(() => {
187
- $(!1), D("submitted");
187
+ A(!1), j("submitted");
188
188
  }, 300));
189
- }, [C, M, a, ce, D]), te = d((o) => {
190
- const _ = o.action || "custom";
191
- switch (_) {
189
+ }, [c, S, a, re, j]), pe = p((d) => {
190
+ const L = d.action || "custom";
191
+ switch (L) {
192
192
  case "submit":
193
193
  fe();
194
194
  break;
195
195
  case "cancel":
196
- c == null || c({
197
- formId: C,
196
+ l == null || l({
197
+ formId: c,
198
198
  action: "cancel",
199
- buttonName: o.name || "cancel",
199
+ buttonName: d.name || "cancel",
200
200
  timestamp: Date.now()
201
201
  }), setTimeout(() => {
202
- D("cancelled");
202
+ j("cancelled");
203
203
  }, 150);
204
204
  break;
205
205
  case "reset":
206
- ge(), l == null || l({
207
- formId: C,
206
+ de(), n == null || n({
207
+ formId: c,
208
208
  action: "reset",
209
- buttonName: o.name || "reset",
209
+ buttonName: d.name || "reset",
210
210
  timestamp: Date.now()
211
211
  });
212
212
  break;
213
213
  case "custom":
214
214
  default:
215
- s == null || s({
216
- formId: C,
217
- action: _,
218
- buttonName: o.name || o.label,
219
- buttonLabel: o.label,
220
- values: { ...M },
215
+ i == null || i({
216
+ formId: c,
217
+ action: L,
218
+ buttonName: d.name || d.label,
219
+ buttonLabel: d.label,
220
+ values: { ...S },
221
221
  timestamp: Date.now()
222
222
  }), setTimeout(() => {
223
- D("submitted");
223
+ j("submitted");
224
224
  }, 150);
225
225
  break;
226
226
  }
227
- }, [C, M, fe, c, l, s, ge, D]);
228
- return L ? /* @__PURE__ */ e.createElement(
227
+ }, [c, S, fe, l, n, i, de, j]);
228
+ return T ? /* @__PURE__ */ e.createElement(
229
229
  "div",
230
230
  {
231
- ref: i,
232
- className: `artifactuse-inline-form artifactuse-form-${h.variant || "fields"} ${u} ${r}`,
233
- "data-artifactuse-theme": v
231
+ ref: o,
232
+ className: `artifactuse-inline-form artifactuse-form-${h.variant || "fields"} ${$} ${m}`,
233
+ "data-artifactuse-theme": u
234
234
  },
235
235
  /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-collapsed" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-collapsed-icon" }, k === "submitted" && /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ e.createElement("polyline", { points: "20 6 9 17 4 12" })), k === "cancelled" && /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ e.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ e.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" })), k === "inactive" && /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ e.createElement("line", { x1: "5", y1: "12", x2: "19", y2: "12" }))), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-form-collapsed-title" }, g))
236
236
  ) : h.variant === "buttons" ? /* @__PURE__ */ e.createElement(
237
237
  "div",
238
238
  {
239
- ref: i,
240
- className: `artifactuse-inline-form artifactuse-form-buttons ${r}`,
241
- "data-artifactuse-theme": v
239
+ ref: o,
240
+ className: `artifactuse-inline-form artifactuse-form-buttons ${m}`,
241
+ "data-artifactuse-theme": u
242
242
  },
243
243
  (h.title || h.description) && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-header" }, h.title && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-title" }, h.title), h.description && /* @__PURE__ */ e.createElement("p", { className: "artifactuse-form-description" }, h.description)),
244
- /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-buttons" }, se.map((o, _) => /* @__PURE__ */ e.createElement(
244
+ /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-buttons" }, J.map((d, L) => /* @__PURE__ */ e.createElement(
245
245
  "button",
246
246
  {
247
- key: o.name || o.label || _,
247
+ key: d.name || d.label || L,
248
248
  type: "button",
249
- className: `artifactuse-form-btn artifactuse-form-btn-${o.variant || "secondary"}`,
250
- onClick: () => te(o),
251
- disabled: o.disabled || ee
249
+ className: `artifactuse-form-btn artifactuse-form-btn-${d.variant || "secondary"}`,
250
+ onClick: () => pe(d),
251
+ disabled: d.disabled || ae
252
252
  },
253
- o.icon && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-form-btn-icon", dangerouslySetInnerHTML: { __html: o.icon } }),
254
- o.label
253
+ d.icon && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-form-btn-icon", dangerouslySetInnerHTML: { __html: d.icon } }),
254
+ d.label
255
255
  )))
256
256
  ) : /* @__PURE__ */ e.createElement(
257
257
  "div",
258
258
  {
259
- ref: i,
260
- className: `artifactuse-inline-form artifactuse-form-fields ${r}`,
261
- "data-artifactuse-theme": v
259
+ ref: o,
260
+ className: `artifactuse-inline-form artifactuse-form-fields ${m}`,
261
+ "data-artifactuse-theme": u
262
262
  },
263
263
  (h.title || h.description) && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-header" }, h.title && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-title" }, h.title), h.description && /* @__PURE__ */ e.createElement("p", { className: "artifactuse-form-description" }, h.description)),
264
- /* @__PURE__ */ e.createElement("form", { onSubmit: fe, className: "artifactuse-form" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-fields" }, f.map((o, _) => /* @__PURE__ */ e.createElement(
265
- Jt,
264
+ /* @__PURE__ */ e.createElement("form", { onSubmit: fe, className: "artifactuse-form" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-fields" }, E.map((d, L) => /* @__PURE__ */ e.createElement(
265
+ Kt,
266
266
  {
267
- key: o.name || _,
268
- field: o,
269
- formId: C,
270
- value: M[o.name],
271
- error: le[o.name],
272
- isSubmitting: ee,
273
- onChange: (y) => de(o.name, y),
274
- onButtonAction: te
267
+ key: d.name || L,
268
+ field: d,
269
+ formId: c,
270
+ value: S[d.name],
271
+ error: U[d.name],
272
+ isSubmitting: ae,
273
+ onChange: (y) => me(d.name, y),
274
+ onButtonAction: pe
275
275
  }
276
- ))), !z && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-buttons artifactuse-form-buttons-default" }, /* @__PURE__ */ e.createElement(
276
+ ))), !D && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-buttons artifactuse-form-buttons-default" }, /* @__PURE__ */ e.createElement(
277
277
  "button",
278
278
  {
279
279
  type: "button",
280
280
  className: "artifactuse-form-btn artifactuse-form-btn-ghost",
281
- onClick: () => te({ action: "cancel", label: "Cancel" })
281
+ onClick: () => pe({ action: "cancel", label: "Cancel" })
282
282
  },
283
283
  "Cancel"
284
284
  ), /* @__PURE__ */ e.createElement(
@@ -286,27 +286,27 @@ function Ot({
286
286
  {
287
287
  type: "submit",
288
288
  className: "artifactuse-form-btn artifactuse-form-btn-primary",
289
- disabled: ee
289
+ disabled: ae
290
290
  },
291
- ee && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-form-btn-spinner" }),
292
- ee ? "Submitting..." : "Submit"
291
+ ae && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-form-btn-spinner" }),
292
+ ae ? "Submitting..." : "Submit"
293
293
  )))
294
294
  );
295
295
  }
296
- function Jt({ field: t, formId: a, value: c, error: l, isSubmitting: s, onChange: r, onButtonAction: v }) {
297
- const p = `${a}-${t.name}`;
296
+ function Kt({ field: t, formId: a, value: l, error: n, isSubmitting: i, onChange: m, onButtonAction: u }) {
297
+ const r = `${a}-${t.name}`;
298
298
  if (t.type === "buttons")
299
- return /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-buttons" }, (t.fields || []).map((i, k) => /* @__PURE__ */ e.createElement(
299
+ return /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-buttons" }, (t.fields || []).map((o, k) => /* @__PURE__ */ e.createElement(
300
300
  "button",
301
301
  {
302
- key: i.name || i.label || k,
303
- type: i.action === "submit" ? "submit" : "button",
304
- className: `artifactuse-form-btn artifactuse-form-btn-${i.variant || "secondary"}`,
305
- onClick: i.action !== "submit" ? () => v(i) : void 0,
306
- disabled: i.disabled || i.action === "submit" && s
302
+ key: o.name || o.label || k,
303
+ type: o.action === "submit" ? "submit" : "button",
304
+ className: `artifactuse-form-btn artifactuse-form-btn-${o.variant || "secondary"}`,
305
+ onClick: o.action !== "submit" ? () => u(o) : void 0,
306
+ disabled: o.disabled || o.action === "submit" && i
307
307
  },
308
- s && i.action === "submit" ? /* @__PURE__ */ e.createElement("span", { className: "artifactuse-form-btn-spinner" }) : i.icon ? /* @__PURE__ */ e.createElement("span", { className: "artifactuse-form-btn-icon", dangerouslySetInnerHTML: { __html: i.icon } }) : null,
309
- s && i.action === "submit" ? "Submitting..." : i.label
308
+ i && o.action === "submit" ? /* @__PURE__ */ e.createElement("span", { className: "artifactuse-form-btn-spinner" }) : o.icon ? /* @__PURE__ */ e.createElement("span", { className: "artifactuse-form-btn-icon", dangerouslySetInnerHTML: { __html: o.icon } }) : null,
309
+ i && o.action === "submit" ? "Submitting..." : o.label
310
310
  )));
311
311
  if (t.type === "divider")
312
312
  return /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-divider" });
@@ -317,81 +317,81 @@ function Jt({ field: t, formId: a, value: c, error: l, isSubmitting: s, onChange
317
317
  "input",
318
318
  {
319
319
  type: "checkbox",
320
- id: p,
320
+ id: r,
321
321
  name: t.name,
322
- checked: c || !1,
322
+ checked: l || !1,
323
323
  disabled: t.disabled,
324
324
  className: "artifactuse-checkbox",
325
- onChange: (i) => r(i.target.checked)
325
+ onChange: (o) => m(o.target.checked)
326
326
  }
327
- ), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-checkbox-text" }, t.label, t.required && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-required" }, "*"))), t.helpText && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-help-text" }, t.helpText), l && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-error-text" }, l));
327
+ ), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-checkbox-text" }, t.label, t.required && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-required" }, "*"))), t.helpText && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-help-text" }, t.helpText), n && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-error-text" }, n));
328
328
  if (t.type === "radio")
329
- return /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-field" }, t.label && /* @__PURE__ */ e.createElement("label", { className: "artifactuse-label" }, t.label, t.required && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-required" }, "*")), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-radio-group" }, ft(t.options).map((i) => /* @__PURE__ */ e.createElement("label", { key: i.value, className: "artifactuse-radio-label" }, /* @__PURE__ */ e.createElement(
329
+ return /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-field" }, t.label && /* @__PURE__ */ e.createElement("label", { className: "artifactuse-label" }, t.label, t.required && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-required" }, "*")), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-radio-group" }, Et(t.options).map((o) => /* @__PURE__ */ e.createElement("label", { key: o.value, className: "artifactuse-radio-label" }, /* @__PURE__ */ e.createElement(
330
330
  "input",
331
331
  {
332
332
  type: "radio",
333
333
  name: t.name,
334
- value: i.value,
335
- checked: c === i.value,
336
- disabled: i.disabled || t.disabled,
334
+ value: o.value,
335
+ checked: l === o.value,
336
+ disabled: o.disabled || t.disabled,
337
337
  className: "artifactuse-radio",
338
- onChange: () => r(i.value)
338
+ onChange: () => m(o.value)
339
339
  }
340
- ), /* @__PURE__ */ e.createElement("span", null, i.label)))), t.helpText && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-help-text" }, t.helpText), l && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-error-text" }, l));
341
- const x = () => jt(t.type) ? /* @__PURE__ */ e.createElement(
340
+ ), /* @__PURE__ */ e.createElement("span", null, o.label)))), t.helpText && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-help-text" }, t.helpText), n && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-error-text" }, n));
341
+ const x = () => Xt(t.type) ? /* @__PURE__ */ e.createElement(
342
342
  "input",
343
343
  {
344
344
  type: t.type,
345
- id: p,
345
+ id: r,
346
346
  name: t.name,
347
- value: c || "",
347
+ value: l || "",
348
348
  placeholder: t.placeholder,
349
349
  disabled: t.disabled,
350
350
  required: t.required,
351
351
  className: "artifactuse-input",
352
- onChange: (i) => r(t.type === "number" ? Number(i.target.value) : i.target.value)
352
+ onChange: (o) => m(t.type === "number" ? Number(o.target.value) : o.target.value)
353
353
  }
354
354
  ) : t.type === "textarea" ? /* @__PURE__ */ e.createElement(
355
355
  "textarea",
356
356
  {
357
- id: p,
357
+ id: r,
358
358
  name: t.name,
359
- value: c || "",
359
+ value: l || "",
360
360
  placeholder: t.placeholder,
361
361
  disabled: t.disabled,
362
362
  required: t.required,
363
363
  rows: t.rows || 3,
364
364
  className: "artifactuse-textarea",
365
- onChange: (i) => r(i.target.value)
365
+ onChange: (o) => m(o.target.value)
366
366
  }
367
367
  ) : t.type === "select" ? /* @__PURE__ */ e.createElement(
368
368
  "select",
369
369
  {
370
- id: p,
370
+ id: r,
371
371
  name: t.name,
372
- value: c || "",
372
+ value: l || "",
373
373
  disabled: t.disabled,
374
374
  required: t.required,
375
375
  className: "artifactuse-select",
376
- onChange: (i) => r(i.target.value)
376
+ onChange: (o) => m(o.target.value)
377
377
  },
378
378
  /* @__PURE__ */ e.createElement("option", { value: "" }, t.placeholder || "Select..."),
379
- ft(t.options).map((i) => /* @__PURE__ */ e.createElement("option", { key: i.value, value: i.value, disabled: i.disabled }, i.label))
379
+ Et(t.options).map((o) => /* @__PURE__ */ e.createElement("option", { key: o.value, value: o.value, disabled: o.disabled }, o.label))
380
380
  ) : /* @__PURE__ */ e.createElement(
381
381
  "input",
382
382
  {
383
383
  type: "text",
384
- id: p,
384
+ id: r,
385
385
  name: t.name,
386
- value: c || "",
386
+ value: l || "",
387
387
  disabled: t.disabled,
388
388
  className: "artifactuse-input",
389
- onChange: (i) => r(i.target.value)
389
+ onChange: (o) => m(o.target.value)
390
390
  }
391
391
  );
392
- return /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-field" }, /* @__PURE__ */ e.createElement("label", { htmlFor: p, className: "artifactuse-label" }, t.label, t.required && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-required" }, "*")), x(), t.helpText && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-help-text" }, t.helpText), l && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-error-text" }, l));
392
+ return /* @__PURE__ */ e.createElement("div", { className: "artifactuse-form-field" }, /* @__PURE__ */ e.createElement("label", { htmlFor: r, className: "artifactuse-label" }, t.label, t.required && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-required" }, "*")), x(), t.helpText && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-help-text" }, t.helpText), n && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-error-text" }, n));
393
393
  }
394
- const J = '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>', Xt = {
394
+ const O = '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>', Yt = {
395
395
  twitter: 280,
396
396
  linkedin: 3e3,
397
397
  instagram: 2200,
@@ -399,7 +399,7 @@ const J = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0
399
399
  threads: 500,
400
400
  tiktok: 2200,
401
401
  youtube: 100
402
- }, Zt = {
402
+ }, Qt = {
403
403
  twitter: "X",
404
404
  linkedin: "LinkedIn",
405
405
  instagram: "Instagram",
@@ -407,141 +407,141 @@ const J = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0
407
407
  threads: "Threads",
408
408
  tiktok: "TikTok",
409
409
  youtube: "YouTube"
410
- }, Re = ({ type: t = "blue" }) => /* @__PURE__ */ e.createElement("svg", { className: `artifactuse-social-verified artifactuse-social-verified-${t}`, viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ e.createElement("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" })), V = (t) => t ? t >= 1e6 ? `${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${(t / 1e3).toFixed(1)}K` : t.toString() : "0", at = (t) => {
410
+ }, je = ({ type: t = "blue" }) => /* @__PURE__ */ e.createElement("svg", { className: `artifactuse-social-verified artifactuse-social-verified-${t}`, viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ e.createElement("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" })), F = (t) => t ? t >= 1e6 ? `${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${(t / 1e3).toFixed(1)}K` : t.toString() : "0", st = (t) => {
411
411
  try {
412
412
  return new URL(t).hostname.replace("www.", "");
413
413
  } catch {
414
414
  return t;
415
415
  }
416
- }, we = (t) => {
416
+ }, Te = (t) => {
417
417
  if (!t) return "";
418
418
  let a = t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
419
419
  return a = a.replace(/\n/g, "<br>"), a = a.replace(/#(\w+)/g, '<span class="artifactuse-social-hashtag">#$1</span>'), a = a.replace(/@(\w+)/g, '<span class="artifactuse-social-mention">@$1</span>'), a;
420
- }, pt = ({ author: t, content: a, engagement: c, meta: l }) => {
421
- var v, p, x;
422
- const s = a.media || [], r = c.likes || c.retweets || c.replies || c.views;
423
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || J, alt: t.name, className: "artifactuse-social-avatar", onError: (i) => i.target.src = J }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-name" }, /* @__PURE__ */ e.createElement("span", null, t.name), t.verified && /* @__PURE__ */ e.createElement(Re, { type: t.verifiedType || "blue" })), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-meta" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-author-handle" }, t.handle), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-timestamp" }, "· ", l.timestamp || "Just now")))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-text", dangerouslySetInnerHTML: { __html: we(a.text) } }), s.length > 0 && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-media" }, /* @__PURE__ */ e.createElement("div", { className: `artifactuse-social-media-grid ${s.length === 1 ? "artifactuse-social-media-single" : ""}`, "data-count": s.length }, s.slice(0, 4).map((i, k) => /* @__PURE__ */ e.createElement("img", { key: k, src: i.url, alt: i.alt || "", onError: (S) => S.target.style.display = "none" })))), a.link && !s.length && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-card" }, a.link.image && /* @__PURE__ */ e.createElement("img", { src: a.link.image, alt: a.link.title, className: "artifactuse-social-link-image", onError: (i) => i.target.style.display = "none" }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-info" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-domain" }, a.link.domain || at(a.link.url)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-title" }, a.link.title), a.link.description && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-description" }, a.link.description))), a.poll && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-poll" }, a.poll.options.map((i, k) => {
424
- var S, L;
425
- return /* @__PURE__ */ e.createElement("div", { key: k, className: "artifactuse-social-poll-option" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-poll-bar", style: { width: `${((S = a.poll.votes) == null ? void 0 : S[k]) || 0}%` } }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-poll-label" }, /* @__PURE__ */ e.createElement("span", null, i), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-poll-percent" }, ((L = a.poll.votes) == null ? void 0 : L[k]) || 0, "%")));
426
- }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-poll-meta" }, V(a.poll.totalVotes || 0), " votes · ", a.poll.duration || "Poll ended")), a.quote && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-quote" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-quote-header" }, /* @__PURE__ */ e.createElement("img", { src: ((v = a.quote.author) == null ? void 0 : v.avatar) || J, className: "artifactuse-social-quote-avatar", alt: "" }), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-quote-author" }, (p = a.quote.author) == null ? void 0 : p.name), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-quote-handle" }, (x = a.quote.author) == null ? void 0 : x.handle)), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-quote-text" }, a.quote.text))), r && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-engagement" }, /* @__PURE__ */ e.createElement("span", null, V(c.replies || 0), " replies"), /* @__PURE__ */ e.createElement("span", null, V(c.retweets || 0), " reposts"), /* @__PURE__ */ e.createElement("span", null, V(c.likes || 0), " likes"), /* @__PURE__ */ e.createElement("span", null, V(c.views || 0), " views")));
427
- }, Kt = ({ author: t, content: a, engagement: c, meta: l }) => {
428
- const s = c.likes || c.comments || c.shares || c.reposts;
429
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || J, alt: t.name, className: "artifactuse-social-avatar", onError: (r) => r.target.src = J }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-info" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-name" }, t.name, t.connection && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-author-connection" }, "· ", t.connection)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-headline" }, t.headline), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-timestamp" }, l.timestamp || "Just now", " · 🌐"))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-text", dangerouslySetInnerHTML: { __html: we(a.text) } }), a.link && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-card" }, a.link.image && /* @__PURE__ */ e.createElement("img", { src: a.link.image, alt: a.link.title, className: "artifactuse-social-link-image", onError: (r) => r.target.style.display = "none" }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-info" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-title" }, a.link.title), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-domain" }, a.link.domain || at(a.link.url))))), s && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-engagement" }, /* @__PURE__ */ e.createElement("span", null, V(c.likes || 0), " reactions"), /* @__PURE__ */ e.createElement("span", null, V(c.comments || 0), " comments"), /* @__PURE__ */ e.createElement("span", null, V(c.shares || c.reposts || 0), " reposts")));
430
- }, Yt = ({ author: t, content: a, engagement: c, meta: l }) => {
431
- const s = a.media || [];
432
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || J, alt: t.name, className: "artifactuse-social-avatar", onError: (r) => r.target.src = J }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-name" }, t.name, t.verified && /* @__PURE__ */ e.createElement(Re, { type: "blue" })), l.location && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-location" }, l.location))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-media" }, s[0] ? /* @__PURE__ */ e.createElement("img", { src: s[0].url, alt: s[0].alt || "", onError: (r) => r.target.style.display = "none" }) : /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-media-placeholder" })), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-likes" }, V(c.likes || 0), " likes"), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-caption" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-caption-author" }, t.name), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-caption-text", dangerouslySetInnerHTML: { __html: we(a.text) } })), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-timestamp" }, l.timestamp || "JUST NOW"));
433
- }, Qt = ({ author: t, content: a, engagement: c, meta: l }) => {
434
- const s = a.media || [], r = T(() => {
435
- const p = c.reactions || {};
436
- return Object.values(p).reduce((x, i) => x + (i || 0), 0) || c.likes || 0;
437
- }, [c]), v = c.likes || c.comments || c.shares || r;
438
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || J, alt: t.name, className: "artifactuse-social-avatar", onError: (p) => p.target.src = J }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-name" }, t.name), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-timestamp" }, l.timestamp || "Just now", " · 🌐"))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-text", dangerouslySetInnerHTML: { __html: we(a.text) } }), s.length > 0 && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-media" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-media-grid", "data-count": s.length }, s.slice(0, 4).map((p, x) => /* @__PURE__ */ e.createElement("img", { key: x, src: p.url, alt: p.alt || "", onError: (i) => i.target.style.display = "none" })))), a.link && !s.length && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-card" }, a.link.image && /* @__PURE__ */ e.createElement("img", { src: a.link.image, alt: a.link.title, className: "artifactuse-social-link-image", onError: (p) => p.target.style.display = "none" }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-info" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-domain" }, a.link.domain || at(a.link.url)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-title" }, a.link.title)))), v && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-engagement" }, /* @__PURE__ */ e.createElement("span", null, "👍❤️ ", V(r)), /* @__PURE__ */ e.createElement("span", null, V(c.comments || 0), " comments · ", V(c.shares || 0), " shares")));
439
- }, Gt = ({ author: t, content: a, engagement: c, meta: l }) => {
440
- const s = c.likes || c.replies || c.reposts;
441
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || J, alt: t.name, className: "artifactuse-social-avatar", onError: (r) => r.target.src = J }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-name" }, t.name, t.verified && /* @__PURE__ */ e.createElement(Re, { type: "blue" }))), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-timestamp" }, l.timestamp || "Just now")), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-text", dangerouslySetInnerHTML: { __html: we(a.text) } })), s && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-engagement" }, /* @__PURE__ */ e.createElement("span", null, V(c.likes || 0), " likes"), /* @__PURE__ */ e.createElement("span", null, V(c.replies || 0), " replies"), /* @__PURE__ */ e.createElement("span", null, V(c.reposts || 0), " reposts")));
442
- }, ea = ({ author: t, content: a, engagement: c, meta: l }) => {
443
- const s = a.media || [], r = c.likes || c.comments || c.shares;
444
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-thumbnail" }, s[0] ? /* @__PURE__ */ e.createElement("img", { src: s[0].url, alt: "Video thumbnail", onError: (v) => v.target.style.display = "none" }) : /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-thumbnail-placeholder" }), a.duration && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-duration" }, a.duration)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-info" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || J, alt: t.name, className: "artifactuse-social-avatar", onError: (v) => v.target.src = J }), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-author-name" }, "@", t.name), t.verified && /* @__PURE__ */ e.createElement(Re, { type: "blue" })), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-text", dangerouslySetInnerHTML: { __html: we(a.text) } }), a.sound && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-sound" }, "🎵 ", a.sound)), r && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-engagement" }, /* @__PURE__ */ e.createElement("span", null, V(c.likes || 0), " likes"), /* @__PURE__ */ e.createElement("span", null, V(c.comments || 0), " comments"), /* @__PURE__ */ e.createElement("span", null, V(c.shares || 0), " shares")));
445
- }, ta = ({ author: t, content: a, engagement: c, meta: l }) => {
446
- const s = a.media || [];
447
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-thumbnail" }, s[0] ? /* @__PURE__ */ e.createElement("img", { src: s[0].url, alt: "Video thumbnail", onError: (r) => r.target.style.display = "none" }) : /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-thumbnail-placeholder" }), a.duration && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-duration" }, a.duration)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-info" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || J, alt: t.name, className: "artifactuse-social-avatar", onError: (r) => r.target.src = J }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-details" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-title" }, a.title), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-channel" }, t.name), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-meta" }, V(c.views || 0), " views · ", l.timestamp || "Just now"))));
420
+ }, vt = ({ author: t, content: a, engagement: l, meta: n }) => {
421
+ var u, r, x;
422
+ const i = a.media || [], m = l.likes || l.retweets || l.replies || l.views;
423
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || O, alt: t.name, className: "artifactuse-social-avatar", onError: (o) => o.target.src = O }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-name" }, /* @__PURE__ */ e.createElement("span", null, t.name), t.verified && /* @__PURE__ */ e.createElement(je, { type: t.verifiedType || "blue" })), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-meta" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-author-handle" }, t.handle), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-timestamp" }, "· ", n.timestamp || "Just now")))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-text", dangerouslySetInnerHTML: { __html: Te(a.text) } }), i.length > 0 && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-media" }, /* @__PURE__ */ e.createElement("div", { className: `artifactuse-social-media-grid ${i.length === 1 ? "artifactuse-social-media-single" : ""}`, "data-count": i.length }, i.slice(0, 4).map((o, k) => /* @__PURE__ */ e.createElement("img", { key: k, src: o.url, alt: o.alt || "", onError: (M) => M.target.style.display = "none" })))), a.link && !i.length && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-card" }, a.link.image && /* @__PURE__ */ e.createElement("img", { src: a.link.image, alt: a.link.title, className: "artifactuse-social-link-image", onError: (o) => o.target.style.display = "none" }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-info" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-domain" }, a.link.domain || st(a.link.url)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-title" }, a.link.title), a.link.description && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-description" }, a.link.description))), a.poll && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-poll" }, a.poll.options.map((o, k) => {
424
+ var M, T;
425
+ return /* @__PURE__ */ e.createElement("div", { key: k, className: "artifactuse-social-poll-option" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-poll-bar", style: { width: `${((M = a.poll.votes) == null ? void 0 : M[k]) || 0}%` } }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-poll-label" }, /* @__PURE__ */ e.createElement("span", null, o), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-poll-percent" }, ((T = a.poll.votes) == null ? void 0 : T[k]) || 0, "%")));
426
+ }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-poll-meta" }, F(a.poll.totalVotes || 0), " votes · ", a.poll.duration || "Poll ended")), a.quote && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-quote" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-quote-header" }, /* @__PURE__ */ e.createElement("img", { src: ((u = a.quote.author) == null ? void 0 : u.avatar) || O, className: "artifactuse-social-quote-avatar", alt: "" }), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-quote-author" }, (r = a.quote.author) == null ? void 0 : r.name), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-quote-handle" }, (x = a.quote.author) == null ? void 0 : x.handle)), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-quote-text" }, a.quote.text))), m && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-engagement" }, /* @__PURE__ */ e.createElement("span", null, F(l.replies || 0), " replies"), /* @__PURE__ */ e.createElement("span", null, F(l.retweets || 0), " reposts"), /* @__PURE__ */ e.createElement("span", null, F(l.likes || 0), " likes"), /* @__PURE__ */ e.createElement("span", null, F(l.views || 0), " views")));
427
+ }, Gt = ({ author: t, content: a, engagement: l, meta: n }) => {
428
+ const i = l.likes || l.comments || l.shares || l.reposts;
429
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || O, alt: t.name, className: "artifactuse-social-avatar", onError: (m) => m.target.src = O }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-info" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-name" }, t.name, t.connection && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-author-connection" }, "· ", t.connection)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-headline" }, t.headline), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-timestamp" }, n.timestamp || "Just now", " · 🌐"))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-text", dangerouslySetInnerHTML: { __html: Te(a.text) } }), a.link && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-card" }, a.link.image && /* @__PURE__ */ e.createElement("img", { src: a.link.image, alt: a.link.title, className: "artifactuse-social-link-image", onError: (m) => m.target.style.display = "none" }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-info" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-title" }, a.link.title), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-domain" }, a.link.domain || st(a.link.url))))), i && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-engagement" }, /* @__PURE__ */ e.createElement("span", null, F(l.likes || 0), " reactions"), /* @__PURE__ */ e.createElement("span", null, F(l.comments || 0), " comments"), /* @__PURE__ */ e.createElement("span", null, F(l.shares || l.reposts || 0), " reposts")));
430
+ }, ea = ({ author: t, content: a, engagement: l, meta: n }) => {
431
+ const i = a.media || [];
432
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || O, alt: t.name, className: "artifactuse-social-avatar", onError: (m) => m.target.src = O }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-name" }, t.name, t.verified && /* @__PURE__ */ e.createElement(je, { type: "blue" })), n.location && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-location" }, n.location))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-media" }, i[0] ? /* @__PURE__ */ e.createElement("img", { src: i[0].url, alt: i[0].alt || "", onError: (m) => m.target.style.display = "none" }) : /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-media-placeholder" })), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-likes" }, F(l.likes || 0), " likes"), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-caption" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-caption-author" }, t.name), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-caption-text", dangerouslySetInnerHTML: { __html: Te(a.text) } })), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-timestamp" }, n.timestamp || "JUST NOW"));
433
+ }, ta = ({ author: t, content: a, engagement: l, meta: n }) => {
434
+ const i = a.media || [], m = C(() => {
435
+ const r = l.reactions || {};
436
+ return Object.values(r).reduce((x, o) => x + (o || 0), 0) || l.likes || 0;
437
+ }, [l]), u = l.likes || l.comments || l.shares || m;
438
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || O, alt: t.name, className: "artifactuse-social-avatar", onError: (r) => r.target.src = O }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-name" }, t.name), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-timestamp" }, n.timestamp || "Just now", " · 🌐"))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-text", dangerouslySetInnerHTML: { __html: Te(a.text) } }), i.length > 0 && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-media" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-media-grid", "data-count": i.length }, i.slice(0, 4).map((r, x) => /* @__PURE__ */ e.createElement("img", { key: x, src: r.url, alt: r.alt || "", onError: (o) => o.target.style.display = "none" })))), a.link && !i.length && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-card" }, a.link.image && /* @__PURE__ */ e.createElement("img", { src: a.link.image, alt: a.link.title, className: "artifactuse-social-link-image", onError: (r) => r.target.style.display = "none" }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-info" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-domain" }, a.link.domain || st(a.link.url)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-link-title" }, a.link.title)))), u && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-engagement" }, /* @__PURE__ */ e.createElement("span", null, "👍❤️ ", F(m)), /* @__PURE__ */ e.createElement("span", null, F(l.comments || 0), " comments · ", F(l.shares || 0), " shares")));
439
+ }, aa = ({ author: t, content: a, engagement: l, meta: n }) => {
440
+ const i = l.likes || l.replies || l.reposts;
441
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || O, alt: t.name, className: "artifactuse-social-avatar", onError: (m) => m.target.src = O }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-author-name" }, t.name, t.verified && /* @__PURE__ */ e.createElement(je, { type: "blue" }))), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-timestamp" }, n.timestamp || "Just now")), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-text", dangerouslySetInnerHTML: { __html: Te(a.text) } })), i && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-engagement" }, /* @__PURE__ */ e.createElement("span", null, F(l.likes || 0), " likes"), /* @__PURE__ */ e.createElement("span", null, F(l.replies || 0), " replies"), /* @__PURE__ */ e.createElement("span", null, F(l.reposts || 0), " reposts")));
442
+ }, ra = ({ author: t, content: a, engagement: l, meta: n }) => {
443
+ const i = a.media || [], m = l.likes || l.comments || l.shares;
444
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-thumbnail" }, i[0] ? /* @__PURE__ */ e.createElement("img", { src: i[0].url, alt: "Video thumbnail", onError: (u) => u.target.style.display = "none" }) : /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-thumbnail-placeholder" }), a.duration && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-duration" }, a.duration)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-info" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-header" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || O, alt: t.name, className: "artifactuse-social-avatar", onError: (u) => u.target.src = O }), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-social-author-name" }, "@", t.name), t.verified && /* @__PURE__ */ e.createElement(je, { type: "blue" })), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-social-text", dangerouslySetInnerHTML: { __html: Te(a.text) } }), a.sound && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-sound" }, "🎵 ", a.sound)), m && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-engagement" }, /* @__PURE__ */ e.createElement("span", null, F(l.likes || 0), " likes"), /* @__PURE__ */ e.createElement("span", null, F(l.comments || 0), " comments"), /* @__PURE__ */ e.createElement("span", null, F(l.shares || 0), " shares")));
445
+ }, sa = ({ author: t, content: a, engagement: l, meta: n }) => {
446
+ const i = a.media || [];
447
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-thumbnail" }, i[0] ? /* @__PURE__ */ e.createElement("img", { src: i[0].url, alt: "Video thumbnail", onError: (m) => m.target.style.display = "none" }) : /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-thumbnail-placeholder" }), a.duration && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-duration" }, a.duration)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-info" }, /* @__PURE__ */ e.createElement("img", { src: t.avatar || O, alt: t.name, className: "artifactuse-social-avatar", onError: (m) => m.target.src = O }), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-details" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-title" }, a.title), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-channel" }, t.name), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-meta" }, F(l.views || 0), " views · ", n.timestamp || "Just now"))));
448
448
  };
449
- function aa({ artifact: t, theme: a = "dark", onCopy: c }) {
450
- const [l, s] = b("Copy"), r = T(() => {
449
+ function na({ artifact: t, theme: a = "dark", onCopy: l }) {
450
+ const [n, i] = w("Copy"), m = C(() => {
451
451
  try {
452
452
  return JSON.parse(t.code);
453
453
  } catch {
454
454
  return { platform: "twitter", data: {} };
455
455
  }
456
- }, [t.code]), v = (r == null ? void 0 : r.platform) || "twitter", p = (r == null ? void 0 : r.data) || {}, { author: x = {}, content: i = {}, engagement: k = {}, meta: S = {} } = p, L = Xt[v] || 280, u = (i.text || "").length, h = u > L ? "error" : u > L * 0.9 ? "warning" : "", C = d(() => {
457
- const g = i.text || "";
456
+ }, [t.code]), u = (m == null ? void 0 : m.platform) || "twitter", r = (m == null ? void 0 : m.data) || {}, { author: x = {}, content: o = {}, engagement: k = {}, meta: M = {} } = r, T = Yt[u] || 280, $ = (o.text || "").length, h = $ > T ? "error" : $ > T * 0.9 ? "warning" : "", c = p(() => {
457
+ const g = o.text || "";
458
458
  navigator.clipboard.writeText(g).then(() => {
459
- s("Copied!"), setTimeout(() => s("Copy"), 2e3), c == null || c({ platform: v, text: g });
459
+ i("Copied!"), setTimeout(() => i("Copy"), 2e3), l == null || l({ platform: u, text: g });
460
460
  });
461
- }, [i.text, v, c]), f = () => {
462
- const g = { author: x, content: i, engagement: k, meta: S };
463
- switch (v) {
461
+ }, [o.text, u, l]), E = () => {
462
+ const g = { author: x, content: o, engagement: k, meta: M };
463
+ switch (u) {
464
464
  case "twitter":
465
- return /* @__PURE__ */ e.createElement(pt, { ...g });
465
+ return /* @__PURE__ */ e.createElement(vt, { ...g });
466
466
  case "linkedin":
467
- return /* @__PURE__ */ e.createElement(Kt, { ...g });
467
+ return /* @__PURE__ */ e.createElement(Gt, { ...g });
468
468
  case "instagram":
469
- return /* @__PURE__ */ e.createElement(Yt, { ...g });
469
+ return /* @__PURE__ */ e.createElement(ea, { ...g });
470
470
  case "facebook":
471
- return /* @__PURE__ */ e.createElement(Qt, { ...g });
471
+ return /* @__PURE__ */ e.createElement(ta, { ...g });
472
472
  case "threads":
473
- return /* @__PURE__ */ e.createElement(Gt, { ...g });
473
+ return /* @__PURE__ */ e.createElement(aa, { ...g });
474
474
  case "tiktok":
475
- return /* @__PURE__ */ e.createElement(ea, { ...g });
475
+ return /* @__PURE__ */ e.createElement(ra, { ...g });
476
476
  case "youtube":
477
- return /* @__PURE__ */ e.createElement(ta, { ...g });
477
+ return /* @__PURE__ */ e.createElement(sa, { ...g });
478
478
  default:
479
- return /* @__PURE__ */ e.createElement(pt, { ...g });
479
+ return /* @__PURE__ */ e.createElement(vt, { ...g });
480
480
  }
481
481
  };
482
- return /* @__PURE__ */ e.createElement("div", { className: `artifactuse-social artifactuse-social-${v}`, "data-artifactuse-theme": a }, f(), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-actions-bar" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-platform-badge" }, /* @__PURE__ */ e.createElement("span", null, Zt[v] || v)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-actions-right" }, /* @__PURE__ */ e.createElement("span", { className: `artifactuse-social-char-counter ${h}` }, u, "/", L), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-social-copy-btn", onClick: C }, l))));
482
+ return /* @__PURE__ */ e.createElement("div", { className: `artifactuse-social artifactuse-social-${u}`, "data-artifactuse-theme": a }, E(), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-actions-bar" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-platform-badge" }, /* @__PURE__ */ e.createElement("span", null, Qt[u] || u)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-social-actions-right" }, /* @__PURE__ */ e.createElement("span", { className: `artifactuse-social-char-counter ${h}` }, $, "/", T), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-social-copy-btn", onClick: c }, n))));
483
483
  }
484
- function ra({
484
+ function la({
485
485
  isOpen: t = !1,
486
486
  type: a = "image",
487
- src: c = "",
488
- alt: l = "",
489
- caption: s = "",
490
- onClose: r,
491
- className: v = ""
487
+ src: l = "",
488
+ alt: n = "",
489
+ caption: i = "",
490
+ onClose: m,
491
+ className: u = ""
492
492
  }) {
493
- const p = W(null), [x, i] = b(!1), [k, S] = b(!1);
494
- j(() => (S(!0), () => S(!1)), []), j(() => {
495
- var f;
496
- return t ? (document.body.style.overflow = "hidden", (f = p.current) == null || f.focus()) : (document.body.style.overflow = "", i(!1)), () => {
493
+ const r = B(null), [x, o] = w(!1), [k, M] = w(!1);
494
+ z(() => (M(!0), () => M(!1)), []), z(() => {
495
+ var E;
496
+ return t ? (document.body.style.overflow = "hidden", (E = r.current) == null || E.focus()) : (document.body.style.overflow = "", o(!1)), () => {
497
497
  document.body.style.overflow = "";
498
498
  };
499
- }, [t]), j(() => {
500
- function f(g) {
501
- g.key === "Escape" && t && r && r();
499
+ }, [t]), z(() => {
500
+ function E(g) {
501
+ g.key === "Escape" && t && m && m();
502
502
  }
503
- return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
504
- }, [t, r]);
505
- const L = d(() => {
506
- i(!1), r && r();
507
- }, [r]), u = d(() => {
508
- a === "image" && i((f) => !f);
509
- }, [a]), h = d(() => {
510
- const f = document.createElement("a");
511
- f.href = c, f.download = l || "download", document.body.appendChild(f), f.click(), document.body.removeChild(f);
512
- }, [c, l]);
503
+ return document.addEventListener("keydown", E), () => document.removeEventListener("keydown", E);
504
+ }, [t, m]);
505
+ const T = p(() => {
506
+ o(!1), m && m();
507
+ }, [m]), $ = p(() => {
508
+ a === "image" && o((E) => !E);
509
+ }, [a]), h = p(() => {
510
+ const E = document.createElement("a");
511
+ E.href = l, E.download = n || "download", document.body.appendChild(E), E.click(), document.body.removeChild(E);
512
+ }, [l, n]);
513
513
  if (!t || !k)
514
514
  return null;
515
- const C = /* @__PURE__ */ e.createElement(
515
+ const c = /* @__PURE__ */ e.createElement(
516
516
  "div",
517
517
  {
518
- ref: p,
519
- className: `artifactuse-viewer-overlay ${v}`,
520
- onClick: L,
518
+ ref: r,
519
+ className: `artifactuse-viewer-overlay ${u}`,
520
+ onClick: T,
521
521
  tabIndex: -1,
522
522
  role: "dialog",
523
523
  "aria-modal": "true"
524
524
  },
525
- /* @__PURE__ */ e.createElement("div", { className: "artifactuse-viewer-content", onClick: (f) => f.stopPropagation() }, a === "image" && /* @__PURE__ */ e.createElement(
525
+ /* @__PURE__ */ e.createElement("div", { className: "artifactuse-viewer-content", onClick: (E) => E.stopPropagation() }, a === "image" && /* @__PURE__ */ e.createElement(
526
526
  "img",
527
527
  {
528
- src: c,
529
- alt: l,
528
+ src: l,
529
+ alt: n,
530
530
  className: `artifactuse-viewer-image ${x ? "artifactuse-viewer-image--zoomed" : ""}`,
531
- onClick: u
531
+ onClick: $
532
532
  }
533
533
  ), a === "pdf" && /* @__PURE__ */ e.createElement(
534
534
  "iframe",
535
535
  {
536
- src: c,
536
+ src: l,
537
537
  className: "artifactuse-viewer-pdf",
538
- title: l || "PDF Viewer"
538
+ title: n || "PDF Viewer"
539
539
  }
540
540
  ), /* @__PURE__ */ e.createElement(
541
541
  "button",
542
542
  {
543
543
  className: "artifactuse-viewer-close",
544
- onClick: L,
544
+ onClick: T,
545
545
  title: "Close (Esc)"
546
546
  },
547
547
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ e.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))
@@ -549,7 +549,7 @@ function ra({
549
549
  "button",
550
550
  {
551
551
  className: "artifactuse-viewer-control",
552
- onClick: u,
552
+ onClick: $,
553
553
  title: x ? "Zoom out" : "Zoom in"
554
554
  },
555
555
  x ? /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("circle", { cx: "11", cy: "11", r: "8" }), /* @__PURE__ */ e.createElement("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }), /* @__PURE__ */ e.createElement("line", { x1: "8", y1: "11", x2: "14", y2: "11" })) : /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("circle", { cx: "11", cy: "11", r: "8" }), /* @__PURE__ */ e.createElement("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }), /* @__PURE__ */ e.createElement("line", { x1: "11", y1: "8", x2: "11", y2: "14" }), /* @__PURE__ */ e.createElement("line", { x1: "8", y1: "11", x2: "14", y2: "11" }))
@@ -561,249 +561,249 @@ function ra({
561
561
  title: "Download"
562
562
  },
563
563
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), /* @__PURE__ */ e.createElement("polyline", { points: "7 10 12 15 17 10" }), /* @__PURE__ */ e.createElement("line", { x1: "12", y1: "15", x2: "12", y2: "3" }))
564
- )), s && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-viewer-caption" }, s))
564
+ )), i && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-viewer-caption" }, i))
565
565
  );
566
- return qt(C, document.body);
566
+ return jt(c, document.body);
567
567
  }
568
- function sa(t) {
568
+ function ca(t) {
569
569
  if (!t) return null;
570
570
  try {
571
571
  const a = decodeURIComponent(escape(atob(t)));
572
572
  return JSON.parse(a);
573
573
  } catch {
574
574
  try {
575
- const c = t.replace(/&#10;/g, `
575
+ const l = t.replace(/&#10;/g, `
576
576
  `).replace(/&#13;/g, "\r").replace(/&#9;/g, " ").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
577
- return JSON.parse(c);
578
- } catch (c) {
579
- return console.error("Failed to parse artifact data:", c), null;
577
+ return JSON.parse(l);
578
+ } catch (l) {
579
+ return console.error("Failed to parse artifact data:", l), null;
580
580
  }
581
581
  }
582
582
  }
583
- function na(t) {
583
+ function ia(t) {
584
584
  const a = [];
585
585
  if (!t) return a;
586
- const c = /<div\s+class="artifactuse-placeholder[^"]*"[^>]*data-artifact-id="([^"]+)"[^>]*data-artifact-type="([^"]+)"[^>]*data-artifact=["']([^"']*)["'][^>]*><\/div>/gi;
587
- let l = 0, s;
588
- for (; (s = c.exec(t)) !== null; ) {
589
- if (s.index > l) {
590
- const p = t.slice(l, s.index);
591
- p.trim() && a.push({ type: "html", content: p });
586
+ const l = /<div\s+class="artifactuse-placeholder[^"]*"[^>]*data-artifact-id="([^"]+)"[^>]*data-artifact-type="([^"]+)"[^>]*data-artifact=["']([^"']*)["'][^>]*><\/div>/gi;
587
+ let n = 0, i;
588
+ for (; (i = l.exec(t)) !== null; ) {
589
+ if (i.index > n) {
590
+ const r = t.slice(n, i.index);
591
+ r.trim() && a.push({ type: "html", content: r });
592
592
  }
593
- const r = sa(s[3]), v = s[2];
594
- r && (v === "form" && r.isInline ? a.push({ type: "form", artifact: r }) : v === "social" ? a.push({ type: "social", artifact: r }) : a.push({ type: "panel", artifact: r })), l = s.index + s[0].length;
593
+ const m = ca(i[3]), u = i[2];
594
+ m && (u === "form" && m.isInline ? a.push({ type: "form", artifact: m }) : u === "social" ? a.push({ type: "social", artifact: m }) : a.push({ type: "panel", artifact: m })), n = i.index + i[0].length;
595
595
  }
596
- if (l < t.length) {
597
- const r = t.slice(l);
598
- r.trim() && a.push({ type: "html", content: r });
596
+ if (n < t.length) {
597
+ const m = t.slice(n);
598
+ m.trim() && a.push({ type: "html", content: m });
599
599
  }
600
600
  return a.length === 0 && t.trim() && a.push({ type: "html", content: t }), a;
601
601
  }
602
- function la() {
602
+ function oa() {
603
603
  return `msg-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
604
604
  }
605
- function ca({
605
+ function ua({
606
606
  content: t,
607
- messageId: a = la(),
608
- inlineCards: c = !0,
609
- typing: l = !1,
610
- isLastMessage: s = !1,
607
+ messageId: a = oa(),
608
+ inlineCards: l = !0,
609
+ typing: n = !1,
610
+ isLastMessage: i = !1,
611
611
  // Whether this is the last/most recent message
612
- inlinePreview: r = null,
613
- inlineCode: v = null,
614
- tabs: p = null,
612
+ inlinePreview: m = null,
613
+ inlineCode: u = null,
614
+ tabs: r = null,
615
615
  viewMode: x = null,
616
- onArtifactDetected: i,
616
+ onArtifactDetected: o,
617
617
  onArtifactOpen: k,
618
- onArtifactCopy: S,
619
- onArtifactDownload: L,
620
- onFormSubmit: u,
618
+ onArtifactCopy: M,
619
+ onArtifactDownload: T,
620
+ onFormSubmit: $,
621
621
  onFormCancel: h,
622
- onFormButtonClick: C,
623
- onSocialCopy: f,
622
+ onFormButtonClick: c,
623
+ onSocialCopy: E,
624
624
  onMediaOpen: g,
625
- className: z = ""
625
+ className: D = ""
626
626
  }) {
627
- var Be;
627
+ var Ce;
628
628
  const {
629
- processMessage: se,
630
- openArtifact: M,
631
- state: R,
632
- getTheme: le,
633
- instance: q
634
- } = xe(), ee = W(null), $ = W(null), D = W(null), de = W(l), [ce, ge] = b(""), [fe, te] = b([]), [ie, ne] = b(!1), [oe, o] = b(!1), [_, y] = b("image"), [w, H] = b(""), [ae, Ce] = b(""), [Y, Le] = b(""), _e = T(() => typeof le == "function" ? le() : "dark", [le]), ye = (R == null ? void 0 : R.activeArtifactId) || null, Ne = c ?? ((Be = q == null ? void 0 : q.config) == null ? void 0 : Be.inlineCards) ?? !0, Se = T(() => na(ce), [ce]), Ae = T(() => ie || s ? "active" : "inactive", [ie, s]);
635
- j(() => {
636
- l && ne(!0);
637
- }, [l]);
638
- const ue = d((E) => {
639
- y(E.type || "image"), H(E.src || ""), Ce(E.alt || ""), Le(E.caption || ""), o(!0), g && g(E);
640
- }, [g]), Pe = d(() => {
641
- o(!1), H(""), Ce(""), Le("");
642
- }, []), $e = d(() => {
643
- if (!$.current) return;
644
- $.current.querySelectorAll('img[data-lightbox="true"]').forEach((m) => {
645
- m._lightboxHandler && m.removeEventListener("click", m._lightboxHandler), m._lightboxHandler = (F) => {
646
- F.preventDefault(), F.stopPropagation(), ue({
629
+ processMessage: J,
630
+ openArtifact: S,
631
+ state: q,
632
+ getTheme: U,
633
+ instance: R
634
+ } = Me(), ae = B(null), A = B(null), j = B(null), me = B(n), [re, de] = w(""), [fe, pe] = w([]), [ne, Q] = w(!1), [Ee, d] = w(!1), [L, y] = w("image"), [v, P] = w(""), [G, be] = w(""), [Ne, $e] = w(""), Z = C(() => typeof U == "function" ? U() : "dark", [U]), He = (q == null ? void 0 : q.activeArtifactId) || null, Pe = l ?? ((Ce = R == null ? void 0 : R.config) == null ? void 0 : Ce.inlineCards) ?? !0, we = C(() => ia(re), [re]), ke = C(() => ne || i ? "active" : "inactive", [ne, i]);
635
+ z(() => {
636
+ n && Q(!0);
637
+ }, [n]);
638
+ const le = p((_) => {
639
+ y(_.type || "image"), P(_.src || ""), be(_.alt || ""), $e(_.caption || ""), d(!0), g && g(_);
640
+ }, [g]), Ie = p(() => {
641
+ d(!1), P(""), be(""), $e("");
642
+ }, []), Be = p(() => {
643
+ if (!A.current) return;
644
+ A.current.querySelectorAll('img[data-lightbox="true"]').forEach((f) => {
645
+ f._lightboxHandler && f.removeEventListener("click", f._lightboxHandler), f._lightboxHandler = (W) => {
646
+ W.preventDefault(), W.stopPropagation(), le({
647
647
  type: "image",
648
- src: m.src,
649
- alt: m.alt || "",
650
- caption: m.dataset.caption || m.alt || ""
648
+ src: f.src,
649
+ alt: f.alt || "",
650
+ caption: f.dataset.caption || f.alt || ""
651
651
  });
652
- }, m.addEventListener("click", m._lightboxHandler), m.style.cursor = "zoom-in";
653
- }), $.current.querySelectorAll(".artifactuse-image-container img").forEach((m) => {
654
- m._lightboxHandler || (m._lightboxHandler = (F) => {
655
- F.preventDefault(), F.stopPropagation();
656
- const U = m.closest(".artifactuse-image-container"), G = U == null ? void 0 : U.querySelector(".artifactuse-image-caption"), me = (G == null ? void 0 : G.textContent) || m.dataset.caption || m.alt || "";
657
- ue({
652
+ }, f.addEventListener("click", f._lightboxHandler), f.style.cursor = "zoom-in";
653
+ }), A.current.querySelectorAll(".artifactuse-image-container img").forEach((f) => {
654
+ f._lightboxHandler || (f._lightboxHandler = (W) => {
655
+ W.preventDefault(), W.stopPropagation();
656
+ const V = f.closest(".artifactuse-image-container"), K = V == null ? void 0 : V.querySelector(".artifactuse-image-caption"), ue = (K == null ? void 0 : K.textContent) || f.dataset.caption || f.alt || "";
657
+ le({
658
658
  type: "image",
659
- src: m.src,
660
- alt: m.alt || "",
661
- caption: me
659
+ src: f.src,
660
+ alt: f.alt || "",
661
+ caption: ue
662
662
  });
663
- }, m.addEventListener("click", m._lightboxHandler), m.style.cursor = "zoom-in");
664
- }), $.current.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((m) => {
665
- m._lightboxHandler || (m._lightboxHandler = (F) => {
666
- F.preventDefault(), F.stopPropagation();
667
- const U = m.closest(".artifactuse-gallery-item"), G = U == null ? void 0 : U.querySelector(".artifactuse-gallery-caption"), me = (G == null ? void 0 : G.textContent) || m.dataset.caption || m.alt || "";
668
- ue({
663
+ }, f.addEventListener("click", f._lightboxHandler), f.style.cursor = "zoom-in");
664
+ }), A.current.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((f) => {
665
+ f._lightboxHandler || (f._lightboxHandler = (W) => {
666
+ W.preventDefault(), W.stopPropagation();
667
+ const V = f.closest(".artifactuse-gallery-item"), K = V == null ? void 0 : V.querySelector(".artifactuse-gallery-caption"), ue = (K == null ? void 0 : K.textContent) || f.dataset.caption || f.alt || "";
668
+ le({
669
669
  type: "image",
670
- src: m.src,
671
- alt: m.alt || "",
672
- caption: me
670
+ src: f.src,
671
+ alt: f.alt || "",
672
+ caption: ue
673
673
  });
674
- }, m.addEventListener("click", m._lightboxHandler), m.style.cursor = "zoom-in");
675
- }), $.current.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((m) => {
676
- m._pdfHandler && m.removeEventListener("click", m._pdfHandler), m._pdfHandler = (F) => {
677
- F.preventDefault(), F.stopPropagation(), ue({
674
+ }, f.addEventListener("click", f._lightboxHandler), f.style.cursor = "zoom-in");
675
+ }), A.current.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((f) => {
676
+ f._pdfHandler && f.removeEventListener("click", f._pdfHandler), f._pdfHandler = (W) => {
677
+ W.preventDefault(), W.stopPropagation(), le({
678
678
  type: "pdf",
679
- src: m.href,
680
- alt: m.textContent || "PDF Document",
681
- caption: m.title || m.textContent || ""
679
+ src: f.href,
680
+ alt: f.textContent || "PDF Document",
681
+ caption: f.title || f.textContent || ""
682
682
  });
683
- }, m.addEventListener("click", m._pdfHandler);
684
- }), $.current.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((m) => {
685
- var U;
686
- m._pdfHandler && m.removeEventListener("click", m._pdfHandler);
687
- const F = m.dataset.pdfSrc || ((U = m.querySelector("iframe")) == null ? void 0 : U.src) || "";
688
- F && (m._pdfHandler = (G) => {
689
- G.preventDefault(), G.stopPropagation(), ue({
683
+ }, f.addEventListener("click", f._pdfHandler);
684
+ }), A.current.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((f) => {
685
+ var V;
686
+ f._pdfHandler && f.removeEventListener("click", f._pdfHandler);
687
+ const W = f.dataset.pdfSrc || ((V = f.querySelector("iframe")) == null ? void 0 : V.src) || "";
688
+ W && (f._pdfHandler = (K) => {
689
+ K.preventDefault(), K.stopPropagation(), le({
690
690
  type: "pdf",
691
- src: F,
691
+ src: W,
692
692
  alt: "PDF Document",
693
- caption: m.dataset.caption || ""
693
+ caption: f.dataset.caption || ""
694
694
  });
695
- }, m.addEventListener("click", m._pdfHandler), m.style.cursor = "pointer");
696
- }), $.current.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((m) => {
697
- m._clickHandler && m.removeEventListener("click", m._clickHandler), m._clickHandler = (F) => {
698
- if (F.target.closest(".artifactuse-video-play-button")) return;
699
- const U = m.dataset.videoUrl || m.dataset.url;
700
- U && window.open(U, "_blank", "noopener,noreferrer");
701
- }, m.addEventListener("click", m._clickHandler);
695
+ }, f.addEventListener("click", f._pdfHandler), f.style.cursor = "pointer");
696
+ }), A.current.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((f) => {
697
+ f._clickHandler && f.removeEventListener("click", f._clickHandler), f._clickHandler = (W) => {
698
+ if (W.target.closest(".artifactuse-video-play-button")) return;
699
+ const V = f.dataset.videoUrl || f.dataset.url;
700
+ V && window.open(V, "_blank", "noopener,noreferrer");
701
+ }, f.addEventListener("click", f._clickHandler);
702
702
  });
703
- }, [ue]), He = d(() => {
704
- if (!$.current) return;
705
- $.current.querySelectorAll("img").forEach((P) => {
706
- P._lightboxHandler && (P.removeEventListener("click", P._lightboxHandler), delete P._lightboxHandler);
707
- }), $.current.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((P) => {
708
- P._pdfHandler && (P.removeEventListener("click", P._pdfHandler), delete P._pdfHandler);
709
- }), $.current.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((P) => {
710
- P._pdfHandler && (P.removeEventListener("click", P._pdfHandler), delete P._pdfHandler);
711
- }), $.current.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((P) => {
712
- P._clickHandler && (P.removeEventListener("click", P._clickHandler), delete P._clickHandler);
703
+ }, [le]), Se = p(() => {
704
+ if (!A.current) return;
705
+ A.current.querySelectorAll("img").forEach((N) => {
706
+ N._lightboxHandler && (N.removeEventListener("click", N._lightboxHandler), delete N._lightboxHandler);
707
+ }), A.current.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((N) => {
708
+ N._pdfHandler && (N.removeEventListener("click", N._pdfHandler), delete N._pdfHandler);
709
+ }), A.current.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((N) => {
710
+ N._pdfHandler && (N.removeEventListener("click", N._pdfHandler), delete N._pdfHandler);
711
+ }), A.current.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((N) => {
712
+ N._clickHandler && (N.removeEventListener("click", N._clickHandler), delete N._clickHandler);
713
713
  });
714
- }, []), Q = d(() => {
715
- D.current && clearTimeout(D.current), D.current = setTimeout(async () => {
716
- if (q != null && q.initializeContent && $.current)
714
+ }, []), ve = p(() => {
715
+ j.current && clearTimeout(j.current), j.current = setTimeout(async () => {
716
+ if (R != null && R.initializeContent && A.current)
717
717
  try {
718
- await q.initializeContent($.current);
719
- } catch (E) {
720
- console.error("Failed to initialize content:", E);
718
+ await R.initializeContent(A.current);
719
+ } catch (_) {
720
+ console.error("Failed to initialize content:", _);
721
721
  }
722
- $e();
722
+ Be();
723
723
  }, 100);
724
- }, [q, $e]);
725
- j(() => {
724
+ }, [R, Be]);
725
+ z(() => {
726
726
  if (t) {
727
- const E = se(t, a, {
728
- inlinePreview: r,
729
- inlineCode: v,
730
- tabs: p,
727
+ const _ = J(t, a, {
728
+ inlinePreview: m,
729
+ inlineCode: u,
730
+ tabs: r,
731
731
  viewMode: x
732
732
  });
733
- ge(E.html), te(E.artifacts), E.artifacts.length > 0 && i && i(E.artifacts), l || Q();
733
+ de(_.html), pe(_.artifacts), _.artifacts.length > 0 && o && o(_.artifacts), n || ve();
734
734
  }
735
- }, [t, a, se, l, Q, i]), j(() => {
736
- de.current === !0 && l === !1 && Q(), de.current = l;
737
- }, [l, Q]), j(() => (l && ne(!0), l || Q(), () => {
738
- D.current && clearTimeout(D.current), He();
735
+ }, [t, a, J, n, ve, o]), z(() => {
736
+ me.current === !0 && n === !1 && ve(), me.current = n;
737
+ }, [n, ve]), z(() => (n && Q(!0), n || ve(), () => {
738
+ j.current && clearTimeout(j.current), Se();
739
739
  }), []);
740
- const qe = d((E) => {
741
- const Z = E.target.closest(".artifactuse-inline-preview");
742
- if (Z) {
743
- if (Z.dataset.nonClickable) return;
744
- const A = Z.dataset.artifactId;
745
- if (A) {
746
- const O = R.artifacts.find((P) => P.id === A);
747
- O && (M(O), k && k(O));
740
+ const Fe = p((_) => {
741
+ const ce = _.target.closest(".artifactuse-inline-preview");
742
+ if (ce) {
743
+ if (ce.dataset.nonClickable) return;
744
+ const oe = ce.dataset.artifactId;
745
+ if (oe) {
746
+ const ee = q.artifacts.find((N) => N.id === oe);
747
+ ee && (S(ee), k && k(ee));
748
748
  }
749
749
  }
750
- }, [R, M, k]), be = d((E) => {
751
- M(E), k && k(E);
752
- }, [M, k]), De = d((E) => {
753
- S && S(E);
754
- }, [S]), pe = d((E) => {
755
- L && L(E);
756
- }, [L]), Ee = d((E) => {
757
- u && u(E);
758
- }, [u]), Ue = d((E) => {
759
- h && h(E);
760
- }, [h]), ve = d((E) => {
761
- C && C(E);
762
- }, [C]), Me = d((E) => {
763
- f && f(E);
764
- }, [f]), Ie = (E, Z) => {
765
- switch (E.type) {
750
+ }, [q, S, k]), ie = p((_) => {
751
+ S(_), k && k(_);
752
+ }, [S, k]), We = p((_) => {
753
+ M && M(_);
754
+ }, [M]), xe = p((_) => {
755
+ T && T(_);
756
+ }, [T]), Ve = p((_) => {
757
+ $ && $(_);
758
+ }, [$]), he = p((_) => {
759
+ h && h(_);
760
+ }, [h]), ge = p((_) => {
761
+ c && c(_);
762
+ }, [c]), Oe = p((_) => {
763
+ E && E(_);
764
+ }, [E]), _e = (_, ce) => {
765
+ switch (_.type) {
766
766
  case "html":
767
767
  return /* @__PURE__ */ e.createElement(
768
768
  "div",
769
769
  {
770
- key: `html-${Z}`,
771
- dangerouslySetInnerHTML: { __html: E.content }
770
+ key: `html-${ce}`,
771
+ dangerouslySetInnerHTML: { __html: _.content }
772
772
  }
773
773
  );
774
774
  case "form":
775
- return E.artifact.isInline ? /* @__PURE__ */ e.createElement(
776
- Ot,
775
+ return _.artifact.isInline ? /* @__PURE__ */ e.createElement(
776
+ Zt,
777
777
  {
778
- key: `form-${E.artifact.id}`,
779
- artifact: E.artifact,
780
- theme: _e,
781
- initialState: Ae,
782
- onSubmit: Ee,
783
- onCancel: Ue,
784
- onButtonClick: ve
778
+ key: `form-${_.artifact.id}`,
779
+ artifact: _.artifact,
780
+ theme: Z,
781
+ initialState: ke,
782
+ onSubmit: Ve,
783
+ onCancel: he,
784
+ onButtonClick: ge
785
785
  }
786
786
  ) : null;
787
787
  case "social":
788
788
  return /* @__PURE__ */ e.createElement(
789
- aa,
789
+ na,
790
790
  {
791
- key: `social-${E.artifact.id}`,
792
- artifact: E.artifact,
793
- theme: _e,
794
- onCopy: Me
791
+ key: `social-${_.artifact.id}`,
792
+ artifact: _.artifact,
793
+ theme: Z,
794
+ onCopy: Oe
795
795
  }
796
796
  );
797
797
  case "panel":
798
- return Ne ? /* @__PURE__ */ e.createElement(
799
- Dt,
798
+ return Pe ? /* @__PURE__ */ e.createElement(
799
+ Ot,
800
800
  {
801
- key: `panel-${E.artifact.id}`,
802
- artifact: E.artifact,
803
- isActive: ye === E.artifact.id,
804
- onOpen: be,
805
- onCopy: De,
806
- onDownload: pe
801
+ key: `panel-${_.artifact.id}`,
802
+ artifact: _.artifact,
803
+ isActive: He === _.artifact.id,
804
+ onOpen: ie,
805
+ onCopy: We,
806
+ onDownload: xe
807
807
  }
808
808
  ) : null;
809
809
  default:
@@ -813,24 +813,24 @@ function ca({
813
813
  return /* @__PURE__ */ e.createElement(
814
814
  "div",
815
815
  {
816
- ref: ee,
817
- className: `artifactuse-agent-message ${z}`.trim()
816
+ ref: ae,
817
+ className: `artifactuse-agent-message ${D}`.trim()
818
818
  },
819
- /* @__PURE__ */ e.createElement("div", { ref: $, className: "artifactuse-message-content", onClick: qe }, Se.map(Ie)),
819
+ /* @__PURE__ */ e.createElement("div", { ref: A, className: "artifactuse-message-content", onClick: Fe }, we.map(_e)),
820
820
  /* @__PURE__ */ e.createElement(
821
- ra,
821
+ la,
822
822
  {
823
- isOpen: oe,
824
- type: _,
825
- src: w,
826
- alt: ae,
827
- caption: Y,
828
- onClose: Pe
823
+ isOpen: Ee,
824
+ type: L,
825
+ src: v,
826
+ alt: G,
827
+ caption: Ne,
828
+ onClose: Ie
829
829
  }
830
830
  )
831
831
  );
832
832
  }
833
- ca.propTypes = {
833
+ ua.propTypes = {
834
834
  /** The raw message content (markdown/HTML from AI) */
835
835
  content: (t, a) => {
836
836
  if (typeof t[a] != "string")
@@ -877,422 +877,451 @@ ca.propTypes = {
877
877
  return new Error(`${a} must be a string or null`);
878
878
  }
879
879
  };
880
- function Ea({
880
+ function ga({
881
881
  onAIRequest: t,
882
882
  onSave: a,
883
- onExport: c,
884
- className: l = ""
883
+ onExport: l,
884
+ className: n = "",
885
+ panelWidth: i,
886
+ splitPosition: m
885
887
  }) {
886
- var mt;
888
+ var ft;
887
889
  const {
888
- state: s,
890
+ state: u,
889
891
  activeArtifact: r,
890
- artifactCount: v,
891
- hasArtifacts: p,
892
- closePanel: x,
893
- toggleFullscreen: i,
894
- setViewMode: k,
895
- getPanelUrl: S,
896
- openArtifact: L,
897
- instance: u
898
- } = xe(), h = W(null), C = W(null), f = W(null), g = W(null), z = W(null), se = W(null), M = W(null), [R, le] = b(!1), [q, ee] = b(!1), [$, D] = b(!0), [de, ce] = b(!1), [ge, fe] = b(!1), [te, ie] = b(!1), [ne, oe] = b(!1), [o, _] = b("options"), [y, w] = b(""), [H, ae] = b(null), [Ce, Y] = b(""), [Le, _e] = b(!1), [ye, Ne] = b(!1), [Se, Ae] = b([]), [ue, Pe] = b(!1), [$e, He] = b(""), [Q, qe] = b(65), [be, De] = b(50), pe = W(null), Ee = W(null), Ue = W(null), ve = W(null), Me = W(null), Ie = T(() => r ? ze(r.language) : "", [r]), Be = T(() => r ? et(r.language) : "", [r]), E = T(() => {
892
+ artifactCount: x,
893
+ hasArtifacts: o,
894
+ closePanel: k,
895
+ toggleFullscreen: M,
896
+ setViewMode: T,
897
+ getPanelUrl: $,
898
+ openArtifact: h,
899
+ instance: c
900
+ } = Me(), E = B(null), g = B(null), D = B(null), J = B(null), S = B(null), q = B(null), U = B(null), [R, ae] = w(!1), [A, j] = w(!1), [me, re] = w(!0), [de, fe] = w(!1), [pe, ne] = w(!1), [Q, Ee] = w(!1), [d, L] = w(!1), [y, v] = w("options"), [P, G] = w(""), [be, Ne] = w(null), [$e, Z] = w(""), [He, Pe] = w(!1), [we, ke] = w(!1), [le, Ie] = w([]), [Be, Se] = w(!1), [ve, Fe] = w(""), [ie, We] = w(
901
+ () => {
902
+ var s;
903
+ return Math.min(Math.max(i ?? ((s = c == null ? void 0 : c.config) == null ? void 0 : s.panelWidth) ?? 65, 25), 75);
904
+ }
905
+ ), [xe, Ve] = w(
906
+ () => {
907
+ var s;
908
+ return Math.min(Math.max(m ?? ((s = c == null ? void 0 : c.config) == null ? void 0 : s.splitPosition) ?? 50, 20), 80);
909
+ }
910
+ ), he = B(null), ge = B(null);
911
+ z(() => {
912
+ i !== void 0 && We(Math.min(Math.max(i, 25), 75));
913
+ }, [i]), z(() => {
914
+ m !== void 0 && Ve(Math.min(Math.max(m, 20), 80));
915
+ }, [m]);
916
+ const Oe = B(null), _e = B(null), Ce = B(null), _ = C(() => r ? Ue(r.language) : "", [r]), ce = C(() => r ? at(r.language) : "", [r]), oe = C(() => {
899
917
  if (!r) return null;
900
- let n = S(r);
901
- return n && r._refreshToken && (n += (n.includes("?") ? "&" : "?") + "_t=" + r._refreshToken), n;
902
- }, [r, S]), Z = T(() => r ? Wt(r.language) : "plaintext", [r]), A = T(() => s.artifacts.filter((n) => !n.isInline), [s.artifacts]), O = T(() => r ? A.findIndex((n) => n.id === r.id) : -1, [r, A]), P = T(() => {
903
- var n;
904
- return ((n = u == null ? void 0 : u.config) == null ? void 0 : n.branding) !== !1;
905
- }, [u]), rt = T(() => {
906
- var n;
907
- return ((n = u == null ? void 0 : u.share) == null ? void 0 : n.enabled) !== !1;
908
- }, [u]), m = T(() => {
909
- var n;
910
- return ((n = u == null ? void 0 : u.share) == null ? void 0 : n.isAuthenticated()) || !1;
911
- }, [u]), F = T(() => r ? Q : Math.min(Q, 30), [r, Q]), U = d((n) => `<svg viewBox="0 0 24 24" fill="currentColor">${et(n)}</svg>`, []), G = d(() => {
912
- fe(!1), u.state.clearActiveArtifact();
913
- }, [u]), me = d((n) => {
914
- if (n.language !== "smartdiff") return null;
918
+ let s = $(r);
919
+ return s && r._refreshToken && (s += (s.includes("?") ? "&" : "?") + "_t=" + r._refreshToken), s;
920
+ }, [r, $]), ee = C(() => r ? Rt(r.language) : "plaintext", [r]), N = C(() => u.artifacts.filter((s) => !s.isInline), [u.artifacts]), se = C(() => r ? N.findIndex((s) => s.id === r.id) : -1, [r, N]), f = C(() => {
921
+ var s;
922
+ return ((s = c == null ? void 0 : c.config) == null ? void 0 : s.branding) !== !1;
923
+ }, [c]), W = C(() => {
924
+ var s;
925
+ return ((s = c == null ? void 0 : c.share) == null ? void 0 : s.enabled) !== !1;
926
+ }, [c]), V = C(() => {
927
+ var s;
928
+ return ((s = c == null ? void 0 : c.share) == null ? void 0 : s.isAuthenticated()) || !1;
929
+ }, [c]), K = C(() => r ? ie : Math.min(ie, 30), [r, ie]), ue = C(() => {
930
+ var s;
931
+ return ((s = c == null ? void 0 : c.config) == null ? void 0 : s.multiTab) === !0;
932
+ }, [c]);
933
+ C(() => ue ? u.openTabs.map((s) => u.artifacts.find((b) => b.id === s)).filter(Boolean) : [], [ue, u.openTabs, u.artifacts]);
934
+ const nt = p((s) => `<svg viewBox="0 0 24 24" fill="currentColor">${at(s)}</svg>`, []), yt = p(() => {
935
+ ne(!1), c.state.clearActiveArtifact();
936
+ }, [c]), ze = p((s) => {
937
+ if (s.language !== "smartdiff") return null;
915
938
  try {
916
- const N = JSON.parse(n.code);
917
- if (N.oldCode === void 0 || N.newCode === void 0) return null;
918
- const I = N.language || "plaintext", B = dt() && window.Prism.languages[I], X = Vt(N.oldCode, N.newCode).split(`
939
+ const b = JSON.parse(s.code);
940
+ if (b.oldCode === void 0 || b.newCode === void 0) return null;
941
+ const H = b.language || "plaintext", I = pt() && window.Prism.languages[H], X = qt(b.oldCode, b.newCode).split(`
919
942
  `);
920
- return { html: X.map((re) => {
921
- const K = re[0], ke = re.slice(1), he = B ? window.Prism.highlight(ke, B, I) : ke;
922
- return K === "-" ? `<span class="token deleted">${he}</span>` : K === "+" ? `<span class="token inserted">${he}</span>` : he;
943
+ return { html: X.map((te) => {
944
+ const Y = te[0], Le = te.slice(1), ye = I ? window.Prism.highlight(Le, I, H) : Le;
945
+ return Y === "-" ? `<span class="token deleted">${ye}</span>` : Y === "+" ? `<span class="token inserted">${ye}</span>` : ye;
923
946
  }).join(`
924
947
  `), lineCount: X.length };
925
948
  } catch {
926
949
  return null;
927
950
  }
928
- }, []), st = d(() => {
929
- if (!g.current || !(r != null && r.code)) return;
930
- const n = me(r), N = n ? n.lineCount : r.code.split(`
931
- `).length, I = Array.from({ length: N }, (B, X) => `<div>${X + 1}</div>`).join("");
932
- g.current.innerHTML = I;
933
- }, [r, me]), nt = d(() => {
934
- if (C.current && dt() && (r != null && r.code)) {
935
- const n = me(r);
936
- if (n)
937
- C.current.innerHTML = n.html;
951
+ }, []), lt = p(() => {
952
+ if (!J.current || !(r != null && r.code)) return;
953
+ const s = ze(r), b = s ? s.lineCount : r.code.split(`
954
+ `).length, H = Array.from({ length: b }, (I, X) => `<div>${X + 1}</div>`).join("");
955
+ J.current.innerHTML = H;
956
+ }, [r, ze]), ct = p(() => {
957
+ if (g.current && pt() && (r != null && r.code)) {
958
+ const s = ze(r);
959
+ if (s)
960
+ g.current.innerHTML = s.html;
938
961
  else {
939
- const N = window.Prism.languages[Z];
940
- N ? C.current.innerHTML = window.Prism.highlight(
962
+ const b = window.Prism.languages[ee];
963
+ b ? g.current.innerHTML = window.Prism.highlight(
941
964
  r.code,
942
- N,
943
- Z
944
- ) : C.current.textContent = r.code;
965
+ b,
966
+ ee
967
+ ) : g.current.textContent = r.code;
945
968
  }
946
- C.current.dataset.highlighted = "true", setTimeout(() => {
947
- gt();
969
+ g.current.dataset.highlighted = "true", setTimeout(() => {
970
+ bt();
948
971
  }, 0);
949
972
  }
950
- }, [r == null ? void 0 : r.code, Z, me]), gt = d(() => {
951
- var N;
952
- const n = (N = C.current) == null ? void 0 : N.closest("pre");
953
- if (n && z.current && g.current) {
954
- const B = window.getComputedStyle(n).backgroundColor;
955
- B && B !== "rgba(0, 0, 0, 0)" && B !== "transparent" && (z.current.style.backgroundColor = B, g.current.style.backgroundColor = B);
973
+ }, [r == null ? void 0 : r.code, ee, ze]), bt = p(() => {
974
+ var b;
975
+ const s = (b = g.current) == null ? void 0 : b.closest("pre");
976
+ if (s && S.current && J.current) {
977
+ const I = window.getComputedStyle(s).backgroundColor;
978
+ I && I !== "rgba(0, 0, 0, 0)" && I !== "transparent" && (S.current.style.backgroundColor = I, J.current.style.backgroundColor = I);
956
979
  }
957
- }, []), lt = d(() => {
958
- z.current && (z.current.style.backgroundColor = ""), g.current && (g.current.style.backgroundColor = "");
959
- }, []), je = d(() => {
960
- st(), nt();
961
- }, [st, nt]), Oe = ((mt = u.editor) == null ? void 0 : mt.isAvailable()) || !1, ct = d(() => {
962
- !Oe || !se.current || !r || (M.current && (M.current.destroy(), M.current = null), M.current = u.editor.create(se.current, {
980
+ }, []), it = p(() => {
981
+ S.current && (S.current.style.backgroundColor = ""), J.current && (J.current.style.backgroundColor = "");
982
+ }, []), Je = p(() => {
983
+ lt(), ct();
984
+ }, [lt, ct]), Xe = ((ft = c.editor) == null ? void 0 : ft.isAvailable()) || !1, ot = p(() => {
985
+ !Xe || !q.current || !r || (U.current && (U.current.destroy(), U.current = null), U.current = c.editor.create(q.current, {
963
986
  code: r.code || "",
964
987
  language: r.editorLanguage || r.language || "plaintext",
965
- sdkTheme: u.getTheme()
988
+ sdkTheme: c.getTheme()
966
989
  }));
967
- }, [Oe, r, u]), _t = d(() => {
968
- if (!M.current || !r) return;
969
- const n = M.current.getCode();
970
- u.emit("edit:save", {
990
+ }, [Xe, r, c]), Nt = p(() => {
991
+ if (!U.current || !r) return;
992
+ const s = U.current.getCode();
993
+ c.emit("edit:save", {
971
994
  artifactId: r.id,
972
995
  artifact: r,
973
- code: n
996
+ code: s
974
997
  });
975
- }, [r, u]), yt = d(() => {
976
- clearTimeout(ve.current), D(!1), h.current && r && (u.bridge.setIframe(h.current), u.bridge.loadArtifact(r));
977
- }, [r, u]), Nt = d(() => {
978
- clearTimeout(ve.current), D(!1);
979
- }, []), bt = d(() => {
980
- clearTimeout(ve.current), ve.current = setTimeout(() => {
981
- D(!1);
998
+ }, [r, c]), wt = p(() => {
999
+ clearTimeout(_e.current), re(!1), E.current && r && (c.bridge.setIframe(E.current), c.bridge.loadArtifact(r));
1000
+ }, [r, c]), kt = p(() => {
1001
+ clearTimeout(_e.current), re(!1);
1002
+ }, []), xt = p(() => {
1003
+ clearTimeout(_e.current), _e.current = setTimeout(() => {
1004
+ re(!1);
982
1005
  }, 1e3);
983
- }, []), kt = d(async () => {
1006
+ }, []), Ct = p(async () => {
984
1007
  if (r)
985
1008
  try {
986
- await navigator.clipboard.writeText(r.code), le(!0), setTimeout(() => le(!1), 2e3);
987
- } catch (n) {
988
- console.error("Failed to copy:", n);
1009
+ await navigator.clipboard.writeText(r.code), ae(!0), setTimeout(() => ae(!1), 2e3);
1010
+ } catch (s) {
1011
+ console.error("Failed to copy:", s);
989
1012
  }
990
- }, [r]), wt = d(() => {
1013
+ }, [r]), Lt = p(() => {
991
1014
  if (!r) return;
992
- const { code: n, language: N, title: I } = r, B = tt(N), X = `${I.toLowerCase().replace(/\s+/g, "-")}.${B}`, Te = new Blob([n], { type: "text/plain" }), re = URL.createObjectURL(Te), K = document.createElement("a");
993
- K.href = re, K.download = X, document.body.appendChild(K), K.click(), document.body.removeChild(K), URL.revokeObjectURL(re);
994
- }, [r]), xt = d(async () => {
995
- if (!(te || A.length === 0)) {
996
- ie(!0);
1015
+ const { code: s, language: b, title: H } = r, I = rt(b), X = `${H.toLowerCase().replace(/\s+/g, "-")}.${I}`, Ae = new Blob([s], { type: "text/plain" }), te = URL.createObjectURL(Ae), Y = document.createElement("a");
1016
+ Y.href = te, Y.download = X, document.body.appendChild(Y), Y.click(), document.body.removeChild(Y), URL.revokeObjectURL(te);
1017
+ }, [r]), Tt = p(async () => {
1018
+ if (!(Q || N.length === 0)) {
1019
+ Ee(!0);
997
1020
  try {
998
- const n = new Rt(), N = /* @__PURE__ */ new Map();
999
- for (const K of A) {
1000
- if (!K.code) continue;
1001
- const ke = tt(K.language);
1002
- let he = (K.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Qe = `${he}.${ke}`;
1003
- const Ge = N.get(Qe) || 0;
1004
- Ge > 0 && (Qe = `${he}-${Ge}.${ke}`), N.set(`${he}.${ke}`, Ge + 1), n.file(Qe, K.code);
1021
+ const s = new Ut(), b = /* @__PURE__ */ new Map();
1022
+ for (const Y of N) {
1023
+ if (!Y.code) continue;
1024
+ const Le = rt(Y.language);
1025
+ let ye = (Y.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), et = `${ye}.${Le}`;
1026
+ const tt = b.get(et) || 0;
1027
+ tt > 0 && (et = `${ye}-${tt}.${Le}`), b.set(`${ye}.${Le}`, tt + 1), s.file(et, Y.code);
1005
1028
  }
1006
- const I = await n.generateAsync({ type: "blob" }), X = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, Te = URL.createObjectURL(I), re = document.createElement("a");
1007
- re.href = Te, re.download = X, document.body.appendChild(re), re.click(), document.body.removeChild(re), URL.revokeObjectURL(Te);
1008
- } catch (n) {
1009
- console.error("Failed to create ZIP:", n);
1029
+ const H = await s.generateAsync({ type: "blob" }), X = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, Ae = URL.createObjectURL(H), te = document.createElement("a");
1030
+ te.href = Ae, te.download = X, document.body.appendChild(te), te.click(), document.body.removeChild(te), URL.revokeObjectURL(Ae);
1031
+ } catch (s) {
1032
+ console.error("Failed to create ZIP:", s);
1010
1033
  } finally {
1011
- ie(!1);
1034
+ Ee(!1);
1012
1035
  }
1013
1036
  }
1014
- }, [te, A]), it = d((n) => n ? new Date(n).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "", []), Ct = d(() => {
1015
- if (ne) {
1016
- oe(!1);
1037
+ }, [Q, N]), ut = p((s) => s ? new Date(s).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "", []), Mt = p(() => {
1038
+ if (d) {
1039
+ L(!1);
1017
1040
  return;
1018
1041
  }
1019
- r && (_("options"), w(""), ae(null), Y(""), _e(!1), Ne(!1), Ae([]), Pe(!1), He(""), oe(!0));
1020
- }, [r, u, ne]), Lt = d(() => {
1021
- oe(!1);
1022
- }, []), Je = d(async () => {
1023
- if (!(!r || !(u != null && u.share))) {
1024
- _("loading"), Y("");
1042
+ r && (v("options"), G(""), Ne(null), Z(""), Pe(!1), ke(!1), Ie([]), Se(!1), Fe(""), L(!0));
1043
+ }, [r, c, d]), Pt = p(() => {
1044
+ L(!1);
1045
+ }, []), Ze = p(async () => {
1046
+ if (!(!r || !(c != null && c.share))) {
1047
+ v("loading"), Z("");
1025
1048
  try {
1026
- const n = await u.share.share(r);
1027
- w(n.url), ae(n.expiresAt), Ne(!1), _("success");
1028
- } catch (n) {
1029
- Y(n.message || "Failed to create share link"), _("error");
1049
+ const s = await c.share.share(r);
1050
+ G(s.url), Ne(s.expiresAt), ke(!1), v("success");
1051
+ } catch (s) {
1052
+ Z(s.message || "Failed to create share link"), v("error");
1030
1053
  }
1031
1054
  }
1032
- }, [r, u]), ot = d(async () => {
1033
- if (m)
1034
- Fe();
1055
+ }, [r, c]), mt = p(async () => {
1056
+ if (V)
1057
+ Re();
1035
1058
  else {
1036
- _("loading");
1059
+ v("loading");
1037
1060
  try {
1038
- await u.share.openAuthPopup(), Fe();
1039
- } catch (n) {
1040
- n.message === "Authentication cancelled" ? _("options") : (Y(n.message || "Authentication failed"), _("error"));
1061
+ await c.share.openAuthPopup(), Re();
1062
+ } catch (s) {
1063
+ s.message === "Authentication cancelled" ? v("options") : (Z(s.message || "Authentication failed"), v("error"));
1041
1064
  }
1042
1065
  }
1043
- }, [m, u]), Fe = d(async () => {
1044
- if (!(!r || !(u != null && u.share))) {
1045
- _("loading"), Y("");
1066
+ }, [V, c]), Re = p(async () => {
1067
+ if (!(!r || !(c != null && c.share))) {
1068
+ v("loading"), Z("");
1046
1069
  try {
1047
- const n = await u.share.save(r);
1048
- w(n.url), ae(null), Ne(!0), _("success");
1049
- } catch (n) {
1050
- Y(n.message || "Failed to save artifact"), _("error");
1070
+ const s = await c.share.save(r);
1071
+ G(s.url), Ne(null), ke(!0), v("success");
1072
+ } catch (s) {
1073
+ Z(s.message || "Failed to save artifact"), v("error");
1051
1074
  }
1052
1075
  }
1053
- }, [r, u]), Pt = d(() => {
1054
- ye ? Fe() : Je();
1055
- }, [ye, Fe, Je]), Mt = d(async () => {
1056
- if (u != null && u.share) {
1057
- if (!m) {
1058
- _("loading");
1076
+ }, [r, c]), St = p(() => {
1077
+ we ? Re() : Ze();
1078
+ }, [we, Re, Ze]), At = p(async () => {
1079
+ if (c != null && c.share) {
1080
+ if (!V) {
1081
+ v("loading");
1059
1082
  try {
1060
- await u.share.openAuthPopup();
1061
- } catch (n) {
1062
- n.message === "Authentication cancelled" ? _("options") : (Y(n.message || "Authentication failed"), _("error"));
1083
+ await c.share.openAuthPopup();
1084
+ } catch (s) {
1085
+ s.message === "Authentication cancelled" ? v("options") : (Z(s.message || "Authentication failed"), v("error"));
1063
1086
  return;
1064
1087
  }
1065
1088
  }
1066
- _("update-list"), Pe(!0);
1089
+ v("update-list"), Se(!0);
1067
1090
  try {
1068
- const n = (r == null ? void 0 : r.language) || null, N = await u.share.listArtifacts(n);
1069
- Ae(N.projects || []);
1070
- } catch (n) {
1071
- Y(n.message || "Failed to load artifacts"), _("error");
1091
+ const s = (r == null ? void 0 : r.language) || null, b = await c.share.listArtifacts(s);
1092
+ Ie(b.projects || []);
1093
+ } catch (s) {
1094
+ Z(s.message || "Failed to load artifacts"), v("error");
1072
1095
  } finally {
1073
- Pe(!1);
1096
+ Se(!1);
1074
1097
  }
1075
1098
  }
1076
- }, [r, u, m]), Tt = d(async (n) => {
1077
- var I, B;
1078
- if (!r || !(u != null && u.share)) return;
1079
- const N = (I = n.project) == null ? void 0 : I.uuid;
1080
- if (N) {
1081
- _("loading"), Y("");
1099
+ }, [r, c, V]), $t = p(async (s) => {
1100
+ var H, I;
1101
+ if (!r || !(c != null && c.share)) return;
1102
+ const b = (H = s.project) == null ? void 0 : H.uuid;
1103
+ if (b) {
1104
+ v("loading"), Z("");
1082
1105
  try {
1083
- const X = await u.share.updateArtifact(N, r);
1084
- w(X.url || ""), ae(null), Ne(!0), He(((B = n.project) == null ? void 0 : B.name) || "Untitled"), _("success");
1106
+ const X = await c.share.updateArtifact(b, r);
1107
+ G(X.url || ""), Ne(null), ke(!0), Fe(((I = s.project) == null ? void 0 : I.name) || "Untitled"), v("success");
1085
1108
  } catch (X) {
1086
- Y(X.message || "Failed to update artifact"), _("error");
1109
+ Z(X.message || "Failed to update artifact"), v("error");
1087
1110
  }
1088
1111
  }
1089
- }, [r, u]), St = d(async () => {
1090
- if (y)
1112
+ }, [r, c]), Ht = p(async () => {
1113
+ if (P)
1091
1114
  try {
1092
- await navigator.clipboard.writeText(y), _e(!0), setTimeout(() => _e(!1), 2e3);
1093
- } catch (n) {
1094
- console.error("Failed to copy link:", n);
1115
+ await navigator.clipboard.writeText(P), Pe(!0), setTimeout(() => Pe(!1), 2e3);
1116
+ } catch (s) {
1117
+ console.error("Failed to copy link:", s);
1095
1118
  }
1096
- }, [y]), At = d(() => {
1097
- O > 0 && L(A[O - 1]);
1098
- }, [O, L, A]), $t = d(() => {
1099
- O < A.length - 1 && L(A[O + 1]);
1100
- }, [O, L, A]), ut = d((n) => {
1101
- fe(!0), L(n), ee(!1);
1102
- }, [L]), Xe = d((n) => {
1103
- pe.current = {
1104
- startX: n.clientX,
1105
- startWidth: Q
1106
- }, document.addEventListener("mousemove", Ze), document.addEventListener("mouseup", We), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((N) => {
1107
- N.style.pointerEvents = "none";
1119
+ }, [P]);
1120
+ p((s) => {
1121
+ h(s);
1122
+ }, [h]), p((s) => {
1123
+ c.closeTab(s), u.openTabs.length === 0 && ne(!1);
1124
+ }, [c, u.openTabs]);
1125
+ const It = p(() => {
1126
+ se > 0 && h(N[se - 1]);
1127
+ }, [se, h, N]), Bt = p(() => {
1128
+ se < N.length - 1 && h(N[se + 1]);
1129
+ }, [se, h, N]), dt = p((s) => {
1130
+ ne(!0), h(s), j(!1);
1131
+ }, [h]), Ke = p((s) => {
1132
+ he.current = {
1133
+ startX: s.clientX,
1134
+ startWidth: ie
1135
+ }, document.addEventListener("mousemove", Ye), document.addEventListener("mouseup", qe), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((b) => {
1136
+ b.style.pointerEvents = "none";
1108
1137
  });
1109
- }, [Q]), Ze = d((n) => {
1110
- if (!pe.current) return;
1111
- const N = window.innerWidth, B = (pe.current.startX - n.clientX) / N * 100, X = pe.current.startWidth + B;
1112
- qe(Math.min(Math.max(X, 25), 75));
1113
- }, []), We = d(() => {
1114
- pe.current = null, document.removeEventListener("mousemove", Ze), document.removeEventListener("mouseup", We), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((n) => {
1115
- n.style.pointerEvents = "";
1138
+ }, [ie]), Ye = p((s) => {
1139
+ if (!he.current) return;
1140
+ const b = window.innerWidth, I = (he.current.startX - s.clientX) / b * 100, X = he.current.startWidth + I;
1141
+ We(Math.min(Math.max(X, 25), 75));
1142
+ }, []), qe = p(() => {
1143
+ he.current = null, document.removeEventListener("mousemove", Ye), document.removeEventListener("mouseup", qe), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((s) => {
1144
+ s.style.pointerEvents = "";
1116
1145
  });
1117
- }, [Ze]), Ht = d((n) => {
1118
- if (!f.current) return;
1119
- const N = f.current.getBoundingClientRect();
1120
- Ee.current = {
1121
- startX: n.clientX,
1122
- startPosition: be,
1123
- contentLeft: N.left,
1124
- contentWidth: N.width
1125
- }, document.addEventListener("mousemove", Ke), document.addEventListener("mouseup", Ve), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((I) => {
1126
- I.style.pointerEvents = "none";
1146
+ }, [Ye]), Ft = p((s) => {
1147
+ if (!D.current) return;
1148
+ const b = D.current.getBoundingClientRect();
1149
+ ge.current = {
1150
+ startX: s.clientX,
1151
+ startPosition: xe,
1152
+ contentLeft: b.left,
1153
+ contentWidth: b.width
1154
+ }, document.addEventListener("mousemove", Qe), document.addEventListener("mouseup", De), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((H) => {
1155
+ H.style.pointerEvents = "none";
1127
1156
  });
1128
- }, [be]), Ke = d((n) => {
1129
- if (!Ee.current) return;
1130
- const I = (n.clientX - Ee.current.contentLeft) / Ee.current.contentWidth * 100;
1131
- De(Math.min(Math.max(I, 20), 80));
1132
- }, []), Ve = d(() => {
1133
- Ee.current = null, document.removeEventListener("mousemove", Ke), document.removeEventListener("mouseup", Ve), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((n) => {
1134
- n.style.pointerEvents = "";
1157
+ }, [xe]), Qe = p((s) => {
1158
+ if (!ge.current) return;
1159
+ const H = (s.clientX - ge.current.contentLeft) / ge.current.contentWidth * 100;
1160
+ Ve(Math.min(Math.max(H, 20), 80));
1161
+ }, []), De = p(() => {
1162
+ ge.current = null, document.removeEventListener("mousemove", Qe), document.removeEventListener("mouseup", De), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((s) => {
1163
+ s.style.pointerEvents = "";
1135
1164
  });
1136
- }, [Ke]);
1137
- if (j(() => {
1138
- r && (Me.current && Me.current.isPreviewable !== r.isPreviewable && (ce(!0), setTimeout(() => ce(!1), 150)), Me.current = r, lt(), D(!0), bt(), je());
1139
- }, [r == null ? void 0 : r.id, lt]), j(() => {
1140
- (s.viewMode === "code" || s.viewMode === "split") && je(), s.viewMode === "edit" && ct();
1141
- }, [s.viewMode, je, ct]), j(() => (t && u.on("ai:request", t), a && u.on("save:request", a), c && u.on("export:complete", c), () => {
1142
- t && u.off("ai:request", t), a && u.off("save:request", a), c && u.off("export:complete", c);
1143
- }), [u, t, a, c]), j(() => () => {
1144
- We(), Ve(), M.current && (M.current.destroy(), M.current = null), clearTimeout(Ue.current), clearTimeout(ve.current);
1145
- }, [We, Ve]), !s.isPanelOpen) return null;
1146
- const Ye = [
1165
+ }, [Qe]);
1166
+ if (z(() => {
1167
+ r && (Ce.current && Ce.current.isPreviewable !== r.isPreviewable && (fe(!0), setTimeout(() => fe(!1), 150)), Ce.current = r, it(), re(!0), xt(), Je());
1168
+ }, [r == null ? void 0 : r.id, it]), z(() => {
1169
+ (u.viewMode === "code" || u.viewMode === "split") && Je(), u.viewMode === "edit" && ot();
1170
+ }, [u.viewMode, Je, ot]), z(() => (t && c.on("ai:request", t), a && c.on("save:request", a), l && c.on("export:complete", l), () => {
1171
+ t && c.off("ai:request", t), a && c.off("save:request", a), l && c.off("export:complete", l);
1172
+ }), [c, t, a, l]), z(() => () => {
1173
+ qe(), De(), U.current && (U.current.destroy(), U.current = null), clearTimeout(Oe.current), clearTimeout(_e.current);
1174
+ }, [qe, De]), !u.isPanelOpen) return null;
1175
+ const Ge = [
1147
1176
  "artifactuse-panel",
1148
- s.isFullscreen && "artifactuse-panel--fullscreen",
1149
- !r && p && "artifactuse-panel--list",
1150
- !p && "artifactuse-panel--empty",
1151
- l
1152
- ].filter(Boolean).join(" "), It = [
1177
+ u.isFullscreen && "artifactuse-panel--fullscreen",
1178
+ !r && o && "artifactuse-panel--list",
1179
+ !o && "artifactuse-panel--empty",
1180
+ n
1181
+ ].filter(Boolean).join(" "), Wt = [
1153
1182
  "artifactuse-panel__content",
1154
- `artifactuse-panel__content--${s.viewMode}`,
1183
+ `artifactuse-panel__content--${u.viewMode}`,
1155
1184
  de && "artifactuse-panel__content--transitioning"
1156
1185
  ].filter(Boolean).join(" ");
1157
- return p ? r ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
1186
+ return o ? r ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
1158
1187
  "div",
1159
1188
  {
1160
- className: Ye,
1161
- style: s.isFullscreen ? void 0 : { width: `${Q}%` }
1189
+ className: Ge,
1190
+ style: u.isFullscreen ? void 0 : { width: `${ie}%` }
1162
1191
  },
1163
- !s.isFullscreen && /* @__PURE__ */ e.createElement(
1192
+ !u.isFullscreen && /* @__PURE__ */ e.createElement(
1164
1193
  "div",
1165
1194
  {
1166
1195
  className: "artifactuse-panel__resize-handle",
1167
- onMouseDown: Xe
1196
+ onMouseDown: Ke
1168
1197
  },
1169
1198
  /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__resize-handle-line" })
1170
1199
  ),
1171
- /* @__PURE__ */ e.createElement("header", { className: "artifactuse-panel__header" }, ge && /* @__PURE__ */ e.createElement(
1200
+ /* @__PURE__ */ e.createElement("header", { className: "artifactuse-panel__header" }, (ue || pe) && /* @__PURE__ */ e.createElement(
1172
1201
  "button",
1173
1202
  {
1174
1203
  className: "artifactuse-panel__back",
1175
- title: "Back to list",
1176
- onClick: G
1204
+ title: ue ? "Browse artifacts" : "Back to list",
1205
+ onClick: yt
1177
1206
  },
1178
1207
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "15 18 9 12 15 6" }))
1179
1208
  ), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__title" }, /* @__PURE__ */ e.createElement(
1180
1209
  "span",
1181
1210
  {
1182
1211
  className: "artifactuse-panel__icon",
1183
- dangerouslySetInnerHTML: { __html: `<svg viewBox="0 0 24 24" fill="currentColor">${Be}</svg>` }
1212
+ dangerouslySetInnerHTML: { __html: `<svg viewBox="0 0 24 24" fill="currentColor">${ce}</svg>` }
1184
1213
  }
1185
- ), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__title-content" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__name" }, r.title || "Untitled"), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__meta" }, Ie, r.lineCount && ` • ${r.lineCount} lines`))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__tabs" }, (!r.tabs || r.tabs.includes("preview")) && /* @__PURE__ */ e.createElement(
1214
+ ), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__title-content" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__name" }, r.title || "Untitled"), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__meta" }, _, r.lineCount && ` • ${r.lineCount} lines`))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__tabs" }, (!r.tabs || r.tabs.includes("preview")) && /* @__PURE__ */ e.createElement(
1186
1215
  "button",
1187
1216
  {
1188
- className: `artifactuse-panel__tab ${s.viewMode === "preview" ? "artifactuse-panel__tab--active" : ""}`,
1217
+ className: `artifactuse-panel__tab ${u.viewMode === "preview" ? "artifactuse-panel__tab--active" : ""}`,
1189
1218
  disabled: !r.isPreviewable,
1190
1219
  title: "Preview",
1191
- onClick: () => k("preview")
1220
+ onClick: () => T("preview")
1192
1221
  },
1193
1222
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }), /* @__PURE__ */ e.createElement("circle", { cx: "12", cy: "12", r: "3" }))
1194
1223
  ), (!r.tabs || r.tabs.includes("code")) && /* @__PURE__ */ e.createElement(
1195
1224
  "button",
1196
1225
  {
1197
- className: `artifactuse-panel__tab ${s.viewMode === "code" ? "artifactuse-panel__tab--active" : ""}`,
1226
+ className: `artifactuse-panel__tab ${u.viewMode === "code" ? "artifactuse-panel__tab--active" : ""}`,
1198
1227
  title: "Code",
1199
- onClick: () => k("code")
1228
+ onClick: () => T("code")
1200
1229
  },
1201
1230
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "16 18 22 12 16 6" }), /* @__PURE__ */ e.createElement("polyline", { points: "8 6 2 12 8 18" }))
1202
1231
  ), (!r.tabs || r.tabs.includes("split")) && /* @__PURE__ */ e.createElement(
1203
1232
  "button",
1204
1233
  {
1205
- className: `artifactuse-panel__tab ${s.viewMode === "split" ? "artifactuse-panel__tab--active" : ""}`,
1234
+ className: `artifactuse-panel__tab ${u.viewMode === "split" ? "artifactuse-panel__tab--active" : ""}`,
1206
1235
  disabled: !r.isPreviewable,
1207
1236
  title: "Split view",
1208
- onClick: () => k("split")
1237
+ onClick: () => T("split")
1209
1238
  },
1210
1239
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }), /* @__PURE__ */ e.createElement("line", { x1: "12", y1: "3", x2: "12", y2: "21" }))
1211
- ), r.tabs && r.tabs.includes("edit") && Oe && /* @__PURE__ */ e.createElement(
1240
+ ), r.tabs && r.tabs.includes("edit") && Xe && /* @__PURE__ */ e.createElement(
1212
1241
  "button",
1213
1242
  {
1214
- className: `artifactuse-panel__tab ${s.viewMode === "edit" ? "artifactuse-panel__tab--active" : ""}`,
1243
+ className: `artifactuse-panel__tab ${u.viewMode === "edit" ? "artifactuse-panel__tab--active" : ""}`,
1215
1244
  title: "Edit",
1216
- onClick: () => k("edit")
1245
+ onClick: () => T("edit")
1217
1246
  },
1218
1247
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), /* @__PURE__ */ e.createElement("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" }))
1219
- )), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__actions" }, s.viewMode === "edit" && /* @__PURE__ */ e.createElement(
1248
+ )), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__actions" }, u.viewMode === "edit" && /* @__PURE__ */ e.createElement(
1220
1249
  "button",
1221
1250
  {
1222
1251
  className: "artifactuse-panel__action artifactuse-panel__action--save",
1223
1252
  title: "Save",
1224
- onClick: _t
1253
+ onClick: Nt
1225
1254
  },
1226
1255
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }), /* @__PURE__ */ e.createElement("polyline", { points: "17 21 17 13 7 13 7 21" }), /* @__PURE__ */ e.createElement("polyline", { points: "7 3 7 8 15 8" }))
1227
1256
  ), /* @__PURE__ */ e.createElement(
1228
1257
  "button",
1229
1258
  {
1230
1259
  className: "artifactuse-panel__action",
1231
- title: s.isFullscreen ? "Exit fullscreen" : "Fullscreen",
1232
- onClick: i
1260
+ title: u.isFullscreen ? "Exit fullscreen" : "Fullscreen",
1261
+ onClick: M
1233
1262
  },
1234
- s.isFullscreen ? /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "4 14 10 14 10 20" }), /* @__PURE__ */ e.createElement("polyline", { points: "20 10 14 10 14 4" }), /* @__PURE__ */ e.createElement("line", { x1: "14", y1: "10", x2: "21", y2: "3" }), /* @__PURE__ */ e.createElement("line", { x1: "3", y1: "21", x2: "10", y2: "14" })) : /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "15 3 21 3 21 9" }), /* @__PURE__ */ e.createElement("polyline", { points: "9 21 3 21 3 15" }), /* @__PURE__ */ e.createElement("line", { x1: "21", y1: "3", x2: "14", y2: "10" }), /* @__PURE__ */ e.createElement("line", { x1: "3", y1: "21", x2: "10", y2: "14" }))
1263
+ u.isFullscreen ? /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "4 14 10 14 10 20" }), /* @__PURE__ */ e.createElement("polyline", { points: "20 10 14 10 14 4" }), /* @__PURE__ */ e.createElement("line", { x1: "14", y1: "10", x2: "21", y2: "3" }), /* @__PURE__ */ e.createElement("line", { x1: "3", y1: "21", x2: "10", y2: "14" })) : /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "15 3 21 3 21 9" }), /* @__PURE__ */ e.createElement("polyline", { points: "9 21 3 21 3 15" }), /* @__PURE__ */ e.createElement("line", { x1: "21", y1: "3", x2: "14", y2: "10" }), /* @__PURE__ */ e.createElement("line", { x1: "3", y1: "21", x2: "10", y2: "14" }))
1235
1264
  ), /* @__PURE__ */ e.createElement(
1236
1265
  "button",
1237
1266
  {
1238
1267
  className: "artifactuse-panel__action artifactuse-panel__action--close",
1239
1268
  title: "Close",
1240
- onClick: x
1269
+ onClick: k
1241
1270
  },
1242
1271
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ e.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))
1243
1272
  ))),
1244
- /* @__PURE__ */ e.createElement("div", { className: It, ref: f }, de && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__loading" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__spinner" })), (s.viewMode === "preview" || s.viewMode === "split") && /* @__PURE__ */ e.createElement(
1273
+ /* @__PURE__ */ e.createElement("div", { className: Wt, ref: D }, de && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__loading" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__spinner" })), (u.viewMode === "preview" || u.viewMode === "split") && /* @__PURE__ */ e.createElement(
1245
1274
  "div",
1246
1275
  {
1247
1276
  className: "artifactuse-panel__preview",
1248
- style: s.viewMode === "split" ? { width: `${be}%` } : void 0
1277
+ style: u.viewMode === "split" ? { width: `${xe}%` } : void 0
1249
1278
  },
1250
- $ && E && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__loading" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__spinner" })),
1251
- E ? /* @__PURE__ */ e.createElement(
1279
+ me && oe && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__loading" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__spinner" })),
1280
+ oe ? /* @__PURE__ */ e.createElement(
1252
1281
  "iframe",
1253
1282
  {
1254
- ref: h,
1255
- src: E,
1256
- className: `artifactuse-panel__iframe ${$ ? "artifactuse-panel__iframe--loading" : ""}`,
1283
+ ref: E,
1284
+ src: oe,
1285
+ className: `artifactuse-panel__iframe ${me ? "artifactuse-panel__iframe--loading" : ""}`,
1257
1286
  sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
1258
1287
  allow: "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write",
1259
- onLoad: yt,
1260
- onError: Nt
1288
+ onLoad: wt,
1289
+ onError: kt
1261
1290
  }
1262
- ) : /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__no-preview" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }, /* @__PURE__ */ e.createElement("path", { d: "M9 17H7A5 5 0 0 1 7 7h2" }), /* @__PURE__ */ e.createElement("path", { d: "M15 7h2a5 5 0 1 1 0 10h-2" }), /* @__PURE__ */ e.createElement("line", { x1: "8", y1: "12", x2: "16", y2: "12" })), /* @__PURE__ */ e.createElement("p", null, "Preview not available for ", Ie))
1291
+ ) : /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__no-preview" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }, /* @__PURE__ */ e.createElement("path", { d: "M9 17H7A5 5 0 0 1 7 7h2" }), /* @__PURE__ */ e.createElement("path", { d: "M15 7h2a5 5 0 1 1 0 10h-2" }), /* @__PURE__ */ e.createElement("line", { x1: "8", y1: "12", x2: "16", y2: "12" })), /* @__PURE__ */ e.createElement("p", null, "Preview not available for ", _))
1263
1292
  ), /* @__PURE__ */ e.createElement(
1264
1293
  "div",
1265
1294
  {
1266
1295
  className: "artifactuse-panel__code",
1267
1296
  style: {
1268
- ...s.viewMode === "split" ? { width: `${100 - be}%` } : {},
1269
- display: s.viewMode === "code" || s.viewMode === "split" ? void 0 : "none"
1297
+ ...u.viewMode === "split" ? { width: `${100 - xe}%` } : {},
1298
+ display: u.viewMode === "code" || u.viewMode === "split" ? void 0 : "none"
1270
1299
  }
1271
1300
  },
1272
- s.viewMode === "split" && /* @__PURE__ */ e.createElement(
1301
+ u.viewMode === "split" && /* @__PURE__ */ e.createElement(
1273
1302
  "div",
1274
1303
  {
1275
1304
  className: "artifactuse-panel__split-handle",
1276
- onMouseDown: Ht
1305
+ onMouseDown: Ft
1277
1306
  },
1278
1307
  /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__split-handle-line" })
1279
1308
  ),
1280
- /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__code-scroll", ref: z }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__line-numbers", ref: g }), /* @__PURE__ */ e.createElement("pre", { className: `artifactuse-panel__code-block language-${Z}` }, /* @__PURE__ */ e.createElement(
1309
+ /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__code-scroll", ref: S }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__line-numbers", ref: J }), /* @__PURE__ */ e.createElement("pre", { className: `artifactuse-panel__code-block language-${ee}` }, /* @__PURE__ */ e.createElement(
1281
1310
  "code",
1282
1311
  {
1283
- ref: C,
1284
- className: `language-${Z}`
1312
+ ref: g,
1313
+ className: `language-${ee}`
1285
1314
  }
1286
1315
  )))
1287
1316
  ), /* @__PURE__ */ e.createElement(
1288
1317
  "div",
1289
1318
  {
1290
1319
  className: "artifactuse-panel__edit",
1291
- style: { display: s.viewMode === "edit" ? void 0 : "none" }
1320
+ style: { display: u.viewMode === "edit" ? void 0 : "none" }
1292
1321
  },
1293
- /* @__PURE__ */ e.createElement("div", { ref: se, className: "artifactuse-panel__editor-container" })
1322
+ /* @__PURE__ */ e.createElement("div", { ref: q, className: "artifactuse-panel__editor-container" })
1294
1323
  )),
1295
- /* @__PURE__ */ e.createElement("footer", { className: "artifactuse-panel__footer" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__footer-left" }, P && /* @__PURE__ */ e.createElement(
1324
+ /* @__PURE__ */ e.createElement("footer", { className: "artifactuse-panel__footer" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__footer-left" }, f && /* @__PURE__ */ e.createElement(
1296
1325
  "a",
1297
1326
  {
1298
1327
  href: "https://artifactuse.com",
@@ -1303,12 +1332,12 @@ function Ea({
1303
1332
  },
1304
1333
  /* @__PURE__ */ e.createElement("svg", { width: "16", height: "16", viewBox: "0 0 42 42", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement("path", { d: "M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0", fill: "#5F51C8" }), /* @__PURE__ */ e.createElement("path", { d: "M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z", fill: "#695AE0" })),
1305
1334
  /* @__PURE__ */ e.createElement("span", null, "Artifactuse")
1306
- ), r.code && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__badge artifactuse-panel__badge--secondary" }, Et(r.size))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__footer-right" }, /* @__PURE__ */ e.createElement(
1335
+ ), r.code && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__badge artifactuse-panel__badge--secondary" }, ht(r.size))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__footer-right" }, /* @__PURE__ */ e.createElement(
1307
1336
  "button",
1308
1337
  {
1309
1338
  className: `artifactuse-panel__footer-action ${R ? "artifactuse-panel__footer-action--success" : ""}`,
1310
1339
  title: R ? "Copied!" : "Copy code",
1311
- onClick: kt
1340
+ onClick: Ct
1312
1341
  },
1313
1342
  R ? /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "20 6 9 17 4 12" })) : /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }), /* @__PURE__ */ e.createElement("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }))
1314
1343
  ), /* @__PURE__ */ e.createElement(
@@ -1316,129 +1345,129 @@ function Ea({
1316
1345
  {
1317
1346
  className: "artifactuse-panel__footer-action",
1318
1347
  title: "Download",
1319
- onClick: wt
1348
+ onClick: Lt
1320
1349
  },
1321
1350
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), /* @__PURE__ */ e.createElement("polyline", { points: "7 10 12 15 17 10" }), /* @__PURE__ */ e.createElement("line", { x1: "12", y1: "15", x2: "12", y2: "3" }))
1322
- ), rt && /* @__PURE__ */ e.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ e.createElement(
1351
+ ), W && /* @__PURE__ */ e.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ e.createElement(
1323
1352
  "button",
1324
1353
  {
1325
1354
  className: "artifactuse-panel__footer-action",
1326
1355
  title: "Share",
1327
- onClick: Ct
1356
+ onClick: Mt
1328
1357
  },
1329
1358
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("circle", { cx: "18", cy: "5", r: "3" }), /* @__PURE__ */ e.createElement("circle", { cx: "6", cy: "12", r: "3" }), /* @__PURE__ */ e.createElement("circle", { cx: "18", cy: "19", r: "3" }), /* @__PURE__ */ e.createElement("line", { x1: "8.59", y1: "13.51", x2: "15.42", y2: "17.49" }), /* @__PURE__ */ e.createElement("line", { x1: "15.41", y1: "6.51", x2: "8.59", y2: "10.49" }))
1330
- ), ne && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__header" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-share-popup__title" }, o === "success" ? $e ? "Artifact updated!" : "Link created!" : o === "update-list" ? "Update saved artifact" : "Share Artifact"), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__close", onClick: Lt }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ e.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__body" }, o === "loading" && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__loading" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__spinner" }), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__loading-text" }, "Creating link...")), o === "error" && /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__error" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__error-text" }, Ce)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__actions" }, /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__btn artifactuse-share-popup__btn--secondary", onClick: () => _("options") }, "Back"), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__btn artifactuse-share-popup__btn--primary", onClick: Pt }, "Retry"))), o === "options" && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__options" }, /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__option", onClick: Je }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }), /* @__PURE__ */ e.createElement("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-title" }, "Share link"), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-desc" }, "Expires in 30 days"))), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__option", onClick: ot }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }), /* @__PURE__ */ e.createElement("polyline", { points: "17 21 17 13 7 13 7 21" }), /* @__PURE__ */ e.createElement("polyline", { points: "7 3 7 8 15 8" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-title" }, "Save to account"), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-desc" }, "Permanent, manageable"))), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__option", onClick: Mt }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "23 4 23 10 17 10" }), /* @__PURE__ */ e.createElement("polyline", { points: "1 20 1 14 7 14" }), /* @__PURE__ */ e.createElement("path", { d: "M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-title" }, "Update saved"), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-desc" }, "Replace an existing artifact")))), o === "update-list" && /* @__PURE__ */ e.createElement("div", null, ue ? /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__loading" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__spinner" }), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__loading-text" }, "Loading artifacts...")) : Se.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__empty" }, "No saved artifacts of this type") : /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__artifact-list" }, Se.map((n) => {
1331
- var N, I, B;
1359
+ ), d && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__header" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-share-popup__title" }, y === "success" ? ve ? "Artifact updated!" : "Link created!" : y === "update-list" ? "Update saved artifact" : "Share Artifact"), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__close", onClick: Pt }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ e.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__body" }, y === "loading" && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__loading" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__spinner" }), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__loading-text" }, "Creating link...")), y === "error" && /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__error" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__error-text" }, $e)), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__actions" }, /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__btn artifactuse-share-popup__btn--secondary", onClick: () => v("options") }, "Back"), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__btn artifactuse-share-popup__btn--primary", onClick: St }, "Retry"))), y === "options" && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__options" }, /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__option", onClick: Ze }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }), /* @__PURE__ */ e.createElement("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-title" }, "Share link"), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-desc" }, "Expires in 30 days"))), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__option", onClick: mt }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }), /* @__PURE__ */ e.createElement("polyline", { points: "17 21 17 13 7 13 7 21" }), /* @__PURE__ */ e.createElement("polyline", { points: "7 3 7 8 15 8" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-title" }, "Save to account"), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-desc" }, "Permanent, manageable"))), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__option", onClick: At }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "23 4 23 10 17 10" }), /* @__PURE__ */ e.createElement("polyline", { points: "1 20 1 14 7 14" }), /* @__PURE__ */ e.createElement("path", { d: "M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__option-content" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-title" }, "Update saved"), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__option-desc" }, "Replace an existing artifact")))), y === "update-list" && /* @__PURE__ */ e.createElement("div", null, Be ? /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__loading" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__spinner" }), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__loading-text" }, "Loading artifacts...")) : le.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__empty" }, "No saved artifacts of this type") : /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__artifact-list" }, le.map((s) => {
1360
+ var b, H, I;
1332
1361
  return /* @__PURE__ */ e.createElement(
1333
1362
  "button",
1334
1363
  {
1335
- key: ((N = n.project) == null ? void 0 : N.uuid) || n.id,
1364
+ key: ((b = s.project) == null ? void 0 : b.uuid) || s.id,
1336
1365
  className: "artifactuse-share-popup__artifact-item",
1337
- onClick: () => Tt(n)
1366
+ onClick: () => $t(s)
1338
1367
  },
1339
- /* @__PURE__ */ e.createElement("span", { className: "artifactuse-share-popup__artifact-name" }, ((I = n.project) == null ? void 0 : I.name) || "Untitled"),
1340
- /* @__PURE__ */ e.createElement("span", { className: "artifactuse-share-popup__artifact-date" }, it((B = n.project) == null ? void 0 : B.created_at))
1368
+ /* @__PURE__ */ e.createElement("span", { className: "artifactuse-share-popup__artifact-name" }, ((H = s.project) == null ? void 0 : H.name) || "Untitled"),
1369
+ /* @__PURE__ */ e.createElement("span", { className: "artifactuse-share-popup__artifact-date" }, ut((I = s.project) == null ? void 0 : I.created_at))
1341
1370
  );
1342
- })), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__back-btn", onClick: () => _("options") }, "Back")), o === "success" && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__success" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__success-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "20 6 9 17 4 12" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__link-wrapper" }, /* @__PURE__ */ e.createElement(
1371
+ })), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__back-btn", onClick: () => v("options") }, "Back")), y === "success" && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__success" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__success-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "20 6 9 17 4 12" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__link-wrapper" }, /* @__PURE__ */ e.createElement(
1343
1372
  "input",
1344
1373
  {
1345
1374
  type: "text",
1346
1375
  className: "artifactuse-share-popup__link",
1347
- value: y,
1376
+ value: P,
1348
1377
  readOnly: !0,
1349
- onClick: (n) => n.target.select()
1378
+ onClick: (s) => s.target.select()
1350
1379
  }
1351
1380
  ), /* @__PURE__ */ e.createElement(
1352
1381
  "button",
1353
1382
  {
1354
- className: `artifactuse-share-popup__copy-btn ${Le ? "artifactuse-share-popup__copy-btn--copied" : ""}`,
1355
- onClick: St
1383
+ className: `artifactuse-share-popup__copy-btn ${He ? "artifactuse-share-popup__copy-btn--copied" : ""}`,
1384
+ onClick: Ht
1356
1385
  },
1357
- Le ? "Copied!" : "Copy"
1358
- )), H && !ye && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__expiry" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-share-popup__expiry-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ e.createElement("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /* @__PURE__ */ e.createElement("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }))), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-share-popup__expiry-text" }, "Expires ", it(H))), !ye && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__save-prompt" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?"), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__save-prompt-btn", onClick: ot }, "Save to account")))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__footer" }, /* @__PURE__ */ e.createElement("a", { href: "https://artifactuse.com", target: "_blank", rel: "noopener noreferrer", className: "artifactuse-share-popup__branding" }, /* @__PURE__ */ e.createElement("svg", { width: "12", height: "12", viewBox: "0 0 42 42", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement("path", { d: "M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0", fill: "#5F51C8" }), /* @__PURE__ */ e.createElement("path", { d: "M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z", fill: "#695AE0" })), /* @__PURE__ */ e.createElement("span", null, "Powered by Artifactuse"))))), A.length > 1 && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__nav" }, /* @__PURE__ */ e.createElement(
1386
+ He ? "Copied!" : "Copy"
1387
+ )), be && !we && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__expiry" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-share-popup__expiry-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ e.createElement("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /* @__PURE__ */ e.createElement("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }))), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-share-popup__expiry-text" }, "Expires ", ut(be))), !we && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__save-prompt" }, /* @__PURE__ */ e.createElement("p", { className: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?"), /* @__PURE__ */ e.createElement("button", { className: "artifactuse-share-popup__save-prompt-btn", onClick: mt }, "Save to account")))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-share-popup__footer" }, /* @__PURE__ */ e.createElement("a", { href: "https://artifactuse.com", target: "_blank", rel: "noopener noreferrer", className: "artifactuse-share-popup__branding" }, /* @__PURE__ */ e.createElement("svg", { width: "12", height: "12", viewBox: "0 0 42 42", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement("path", { d: "M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0", fill: "#5F51C8" }), /* @__PURE__ */ e.createElement("path", { d: "M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z", fill: "#695AE0" })), /* @__PURE__ */ e.createElement("span", null, "Powered by Artifactuse"))))), N.length > 1 && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__nav" }, /* @__PURE__ */ e.createElement(
1359
1388
  "button",
1360
1389
  {
1361
1390
  className: "artifactuse-panel__nav-btn",
1362
- disabled: O <= 0,
1391
+ disabled: se <= 0,
1363
1392
  title: "Previous artifact",
1364
- onClick: At
1393
+ onClick: It
1365
1394
  },
1366
1395
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "15 18 9 12 15 6" }))
1367
1396
  ), /* @__PURE__ */ e.createElement(
1368
1397
  "button",
1369
1398
  {
1370
1399
  className: "artifactuse-panel__nav-trigger",
1371
- onClick: () => ee(!q)
1400
+ onClick: () => j(!A)
1372
1401
  },
1373
- /* @__PURE__ */ e.createElement("span", null, O + 1, " / ", A.length),
1402
+ /* @__PURE__ */ e.createElement("span", null, se + 1, " / ", N.length),
1374
1403
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "6 9 12 15 18 9" }))
1375
1404
  ), /* @__PURE__ */ e.createElement(
1376
1405
  "button",
1377
1406
  {
1378
1407
  className: "artifactuse-panel__nav-btn",
1379
- disabled: O >= A.length - 1,
1408
+ disabled: se >= N.length - 1,
1380
1409
  title: "Next artifact",
1381
- onClick: $t
1410
+ onClick: Bt
1382
1411
  },
1383
1412
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "9 18 15 12 9 6" }))
1384
- ), q && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__artifact-list" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__artifact-list-header" }, /* @__PURE__ */ e.createElement("span", null, "All Artifacts (", A.length, ")"), /* @__PURE__ */ e.createElement(
1413
+ ), A && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__artifact-list" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__artifact-list-header" }, /* @__PURE__ */ e.createElement("span", null, "All Artifacts (", N.length, ")"), /* @__PURE__ */ e.createElement(
1385
1414
  "button",
1386
1415
  {
1387
1416
  className: "artifactuse-panel__artifact-list-close",
1388
- onClick: () => ee(!1)
1417
+ onClick: () => j(!1)
1389
1418
  },
1390
1419
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ e.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))
1391
- )), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__artifact-list-items" }, A.map((n, N) => /* @__PURE__ */ e.createElement(
1420
+ )), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__artifact-list-items" }, N.map((s, b) => /* @__PURE__ */ e.createElement(
1392
1421
  "button",
1393
1422
  {
1394
- key: n.id,
1395
- className: `artifactuse-panel__artifact-item ${n.id === r.id ? "artifactuse-panel__artifact-item--active" : ""}`,
1396
- onClick: () => ut(n)
1423
+ key: s.id,
1424
+ className: `artifactuse-panel__artifact-item ${s.id === r.id ? "artifactuse-panel__artifact-item--active" : ""}`,
1425
+ onClick: () => dt(s)
1397
1426
  },
1398
1427
  /* @__PURE__ */ e.createElement(
1399
1428
  "span",
1400
1429
  {
1401
1430
  className: "artifactuse-panel__artifact-item-icon",
1402
- dangerouslySetInnerHTML: { __html: U(n.language) }
1431
+ dangerouslySetInnerHTML: { __html: nt(s.language) }
1403
1432
  }
1404
1433
  ),
1405
- /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__artifact-item-content" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__artifact-item-title" }, n.title || "Untitled"), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__artifact-item-meta" }, ze(n.language), n.lineCount && ` • ${n.lineCount} lines`)),
1406
- /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__artifact-item-index" }, N + 1)
1434
+ /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__artifact-item-content" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__artifact-item-title" }, s.title || "Untitled"), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__artifact-item-meta" }, Ue(s.language), s.lineCount && ` • ${s.lineCount} lines`)),
1435
+ /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__artifact-item-index" }, b + 1)
1407
1436
  )))))))
1408
- )) : /* @__PURE__ */ e.createElement("div", { className: Ye, style: s.isFullscreen ? void 0 : { width: `${F}%` } }, !s.isFullscreen && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__resize-handle", onMouseDown: Xe }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__resize-handle-line" })), /* @__PURE__ */ e.createElement("header", { className: "artifactuse-panel__header artifactuse-panel__header--simple" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__title" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "16 18 22 12 16 6" }), /* @__PURE__ */ e.createElement("polyline", { points: "8 6 2 12 8 18" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__title-content" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__name" }, "Artifacts"), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__meta" }, A.length, " available"))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__actions" }, /* @__PURE__ */ e.createElement(
1437
+ )) : /* @__PURE__ */ e.createElement("div", { className: Ge, style: u.isFullscreen ? void 0 : { width: `${K}%` } }, !u.isFullscreen && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__resize-handle", onMouseDown: Ke }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__resize-handle-line" })), /* @__PURE__ */ e.createElement("header", { className: "artifactuse-panel__header artifactuse-panel__header--simple" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__title" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "16 18 22 12 16 6" }), /* @__PURE__ */ e.createElement("polyline", { points: "8 6 2 12 8 18" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__title-content" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__name" }, "Artifacts"), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__meta" }, N.length, " available"))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__actions" }, /* @__PURE__ */ e.createElement(
1409
1438
  "button",
1410
1439
  {
1411
- className: `artifactuse-panel__action ${te ? "artifactuse-panel__action--loading" : ""}`,
1412
- disabled: te,
1440
+ className: `artifactuse-panel__action ${Q ? "artifactuse-panel__action--loading" : ""}`,
1441
+ disabled: Q,
1413
1442
  title: "Download all as ZIP",
1414
- onClick: xt
1443
+ onClick: Tt
1415
1444
  },
1416
- te ? /* @__PURE__ */ e.createElement("svg", { className: "artifactuse-panel__spinner-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("circle", { cx: "12", cy: "12", r: "10", strokeDasharray: "32", strokeDashoffset: "32" })) : /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), /* @__PURE__ */ e.createElement("polyline", { points: "7 10 12 15 17 10" }), /* @__PURE__ */ e.createElement("line", { x1: "12", y1: "15", x2: "12", y2: "3" }))
1445
+ Q ? /* @__PURE__ */ e.createElement("svg", { className: "artifactuse-panel__spinner-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("circle", { cx: "12", cy: "12", r: "10", strokeDasharray: "32", strokeDashoffset: "32" })) : /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), /* @__PURE__ */ e.createElement("polyline", { points: "7 10 12 15 17 10" }), /* @__PURE__ */ e.createElement("line", { x1: "12", y1: "15", x2: "12", y2: "3" }))
1417
1446
  ), /* @__PURE__ */ e.createElement(
1418
1447
  "button",
1419
1448
  {
1420
1449
  className: "artifactuse-panel__action artifactuse-panel__action--close",
1421
1450
  title: "Close panel",
1422
- onClick: x
1451
+ onClick: k
1423
1452
  },
1424
1453
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ e.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))
1425
- ))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__list" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__list-items" }, A.map((n, N) => /* @__PURE__ */ e.createElement(
1454
+ ))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__list" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__list-items" }, N.map((s, b) => /* @__PURE__ */ e.createElement(
1426
1455
  "button",
1427
1456
  {
1428
- key: n.id,
1457
+ key: s.id,
1429
1458
  className: "artifactuse-panel__list-item",
1430
- onClick: () => ut(n)
1459
+ onClick: () => dt(s)
1431
1460
  },
1432
1461
  /* @__PURE__ */ e.createElement(
1433
1462
  "span",
1434
1463
  {
1435
1464
  className: "artifactuse-panel__list-item-icon",
1436
- dangerouslySetInnerHTML: { __html: U(n.language) }
1465
+ dangerouslySetInnerHTML: { __html: nt(s.language) }
1437
1466
  }
1438
1467
  ),
1439
- /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__list-item-content" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__list-item-title" }, n.title || "Untitled"), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__list-item-meta" }, ze(n.language), n.lineCount && ` • ${n.lineCount} lines`)),
1468
+ /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__list-item-content" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__list-item-title" }, s.title || "Untitled"), /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__list-item-meta" }, Ue(s.language), s.lineCount && ` • ${s.lineCount} lines`)),
1440
1469
  /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__list-item-arrow" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "9 18 15 12 9 6" })))
1441
- )))), /* @__PURE__ */ e.createElement("footer", { className: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, P && /* @__PURE__ */ e.createElement(
1470
+ )))), /* @__PURE__ */ e.createElement("footer", { className: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, f && /* @__PURE__ */ e.createElement(
1442
1471
  "a",
1443
1472
  {
1444
1473
  href: "https://artifactuse.com",
@@ -1448,15 +1477,15 @@ function Ea({
1448
1477
  },
1449
1478
  /* @__PURE__ */ e.createElement("svg", { width: "16", height: "16", viewBox: "0 0 42 42", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement("path", { d: "M16.6667 41.6673V10.4173C16.6667 9.86478 16.4472 9.33488 16.0565 8.94418C15.6658 8.55348 15.1359 8.33398 14.5833 8.33398H4.16667C3.0616 8.33398 2.00179 8.77297 1.22039 9.55437C0.438987 10.3358 0 11.3956 0 12.5007V37.5006C0 38.6057 0.438987 39.6655 1.22039 40.4469C2.00179 41.2283 3.0616 41.6673 4.16667 41.6673H29.1667C30.2717 41.6673 31.3315 41.2283 32.1129 40.4469C32.8943 39.6655 33.3333 38.6057 33.3333 37.5006V27.084C33.3333 26.5314 33.1138 26.0015 32.7231 25.6108C32.3324 25.2201 31.8025 25.0007 31.25 25.0007H0", fill: "#5F51C8" }), /* @__PURE__ */ e.createElement("path", { d: "M39.5833 0H27.0833C25.9327 0 25 0.93274 25 2.08333V14.5833C25 15.7339 25.9327 16.6667 27.0833 16.6667H39.5833C40.7339 16.6667 41.6667 15.7339 41.6667 14.5833V2.08333C41.6667 0.93274 40.7339 0 39.5833 0Z", fill: "#695AE0" })),
1450
1479
  /* @__PURE__ */ e.createElement("span", null, "Artifactuse")
1451
- ))) : /* @__PURE__ */ e.createElement("div", { className: Ye, style: s.isFullscreen ? void 0 : { width: `${F}%` } }, !s.isFullscreen && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__resize-handle", onMouseDown: Xe }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__resize-handle-line" })), /* @__PURE__ */ e.createElement("header", { className: "artifactuse-panel__header artifactuse-panel__header--simple" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__title" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "16 18 22 12 16 6" }), /* @__PURE__ */ e.createElement("polyline", { points: "8 6 2 12 8 18" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__title-content" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__name" }, "Artifacts"))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__actions" }, /* @__PURE__ */ e.createElement(
1480
+ ))) : /* @__PURE__ */ e.createElement("div", { className: Ge, style: u.isFullscreen ? void 0 : { width: `${K}%` } }, !u.isFullscreen && /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__resize-handle", onMouseDown: Ke }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__resize-handle-line" })), /* @__PURE__ */ e.createElement("header", { className: "artifactuse-panel__header artifactuse-panel__header--simple" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__title" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("polyline", { points: "16 18 22 12 16 6" }), /* @__PURE__ */ e.createElement("polyline", { points: "8 6 2 12 8 18" }))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__title-content" }, /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel__name" }, "Artifacts"))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__actions" }, /* @__PURE__ */ e.createElement(
1452
1481
  "button",
1453
1482
  {
1454
1483
  className: "artifactuse-panel__action artifactuse-panel__action--close",
1455
1484
  title: "Close panel",
1456
- onClick: x
1485
+ onClick: k
1457
1486
  },
1458
1487
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ e.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /* @__PURE__ */ e.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))
1459
- ))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__empty" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__empty-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }, /* @__PURE__ */ e.createElement("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" }), /* @__PURE__ */ e.createElement("polyline", { points: "14 2 14 8 20 8" }))), /* @__PURE__ */ e.createElement("h3", { className: "artifactuse-panel__empty-title" }, "No artifacts yet"), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-panel__empty-text" }, "Code blocks, forms, and other interactive content will appear here as the AI generates them.")), /* @__PURE__ */ e.createElement("footer", { className: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, P && /* @__PURE__ */ e.createElement(
1488
+ ))), /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__empty" }, /* @__PURE__ */ e.createElement("div", { className: "artifactuse-panel__empty-icon" }, /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }, /* @__PURE__ */ e.createElement("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" }), /* @__PURE__ */ e.createElement("polyline", { points: "14 2 14 8 20 8" }))), /* @__PURE__ */ e.createElement("h3", { className: "artifactuse-panel__empty-title" }, "No artifacts yet"), /* @__PURE__ */ e.createElement("p", { className: "artifactuse-panel__empty-text" }, "Code blocks, forms, and other interactive content will appear here as the AI generates them.")), /* @__PURE__ */ e.createElement("footer", { className: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, f && /* @__PURE__ */ e.createElement(
1460
1489
  "a",
1461
1490
  {
1462
1491
  href: "https://artifactuse.com",
@@ -1468,159 +1497,167 @@ function Ea({
1468
1497
  /* @__PURE__ */ e.createElement("span", null, "Artifactuse")
1469
1498
  )));
1470
1499
  }
1471
- function va({ className: t = "" }) {
1472
- const { state: a, artifactCount: c, hasArtifacts: l, togglePanel: s } = xe(), r = T(() => c > 99 ? "99+" : String(c), [c]), v = [
1500
+ function _a({ className: t = "" }) {
1501
+ const { state: a, artifactCount: l, hasArtifacts: n, togglePanel: i } = Me(), m = C(() => l > 99 ? "99+" : String(l), [l]), u = [
1473
1502
  "artifactuse-panel-toggle",
1474
1503
  a.isPanelOpen && "artifactuse-panel-toggle--active",
1475
- l && "artifactuse-panel-toggle--has-artifacts",
1504
+ n && "artifactuse-panel-toggle--has-artifacts",
1476
1505
  t
1477
1506
  ].filter(Boolean).join(" ");
1478
1507
  return /* @__PURE__ */ e.createElement(
1479
1508
  "button",
1480
1509
  {
1481
- className: v,
1482
- onClick: s,
1510
+ className: u,
1511
+ onClick: i,
1483
1512
  title: a.isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
1484
1513
  },
1485
1514
  /* @__PURE__ */ e.createElement("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ e.createElement("polyline", { points: "16 18 22 12 16 6" }), /* @__PURE__ */ e.createElement("polyline", { points: "8 6 2 12 8 18" })),
1486
- c > 0 && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel-toggle-badge" }, r)
1515
+ l > 0 && /* @__PURE__ */ e.createElement("span", { className: "artifactuse-panel-toggle-badge" }, m)
1487
1516
  );
1488
1517
  }
1489
- const ht = Bt(null);
1490
- function ia({ children: t, config: a = {} }) {
1491
- const c = W(null);
1492
- c.current || (c.current = zt(a));
1493
- const l = c.current, [s, r] = b({
1518
+ const _t = Vt(null);
1519
+ function ma({ children: t, config: a = {} }) {
1520
+ const l = B(null);
1521
+ l.current || (l.current = Dt(a));
1522
+ const n = l.current, [i, m] = w({
1494
1523
  artifacts: [],
1495
1524
  activeArtifactId: null,
1496
1525
  isPanelOpen: !1,
1497
1526
  viewMode: "preview",
1498
- isFullscreen: !1
1499
- }), [v, p] = b(() => l.getPanelTypes());
1500
- j(() => {
1501
- const f = l.state.subscribe((g) => {
1502
- r({
1527
+ isFullscreen: !1,
1528
+ openTabs: [],
1529
+ tabViewModes: {}
1530
+ }), [u, r] = w(() => n.getPanelTypes());
1531
+ z(() => {
1532
+ const E = n.state.subscribe((g) => {
1533
+ m({
1503
1534
  artifacts: g.artifacts,
1504
1535
  activeArtifactId: g.activeArtifactId,
1505
1536
  isPanelOpen: g.isPanelOpen,
1506
1537
  viewMode: g.viewMode,
1507
- isFullscreen: g.isFullscreen
1538
+ isFullscreen: g.isFullscreen,
1539
+ openTabs: g.openTabs,
1540
+ tabViewModes: g.tabViewModes
1508
1541
  });
1509
1542
  });
1510
- return l.applyTheme(), () => {
1511
- f(), l.destroy();
1543
+ return n.applyTheme(), () => {
1544
+ E(), n.destroy();
1512
1545
  };
1513
- }, [l]);
1514
- const x = T(() => s.activeArtifactId && s.artifacts.find((f) => f.id === s.activeArtifactId) || null, [s.artifacts, s.activeArtifactId]), i = s.artifacts.filter((f) => !f.isInline).length, k = i > 0, S = T(() => x ? l.getPanelUrl(x) : null, [x, l]), L = d((f) => {
1515
- l.setTheme(f), l.applyTheme();
1516
- }, [l]), u = d((f, g) => {
1517
- l.registerPanel(f, g), p(l.getPanelTypes());
1518
- }, [l]), h = d((f) => {
1519
- l.unregisterPanel(f), p(l.getPanelTypes());
1520
- }, [l]), C = T(() => ({
1521
- instance: l,
1522
- state: s,
1546
+ }, [n]);
1547
+ const x = C(() => i.activeArtifactId && i.artifacts.find((E) => E.id === i.activeArtifactId) || null, [i.artifacts, i.activeArtifactId]), o = i.artifacts.filter((E) => !E.isInline).length, k = o > 0, M = C(() => x ? n.getPanelUrl(x) : null, [x, n]), T = p((E) => {
1548
+ n.setTheme(E), n.applyTheme();
1549
+ }, [n]), $ = p((E, g) => {
1550
+ n.registerPanel(E, g), r(n.getPanelTypes());
1551
+ }, [n]), h = p((E) => {
1552
+ n.unregisterPanel(E), r(n.getPanelTypes());
1553
+ }, [n]), c = C(() => ({
1554
+ instance: n,
1555
+ state: i,
1523
1556
  activeArtifact: x,
1524
- artifactCount: i,
1557
+ artifactCount: o,
1525
1558
  hasArtifacts: k,
1526
1559
  // Panel computed
1527
- panelTypes: v,
1528
- activePanelUrl: S,
1560
+ panelTypes: u,
1561
+ activePanelUrl: M,
1529
1562
  // Methods
1530
- processMessage: l.processMessage,
1531
- initializeContent: l.initializeContent,
1532
- openArtifact: l.openArtifact,
1533
- openFile: l.openFile,
1534
- openCode: l.openCode,
1535
- updateFile: l.updateFile,
1536
- closePanel: l.closePanel,
1537
- togglePanel: l.togglePanel,
1538
- toggleFullscreen: l.toggleFullscreen,
1539
- setViewMode: l.setViewMode,
1540
- getPanelUrl: l.getPanelUrl,
1541
- sendToPanel: l.sendToPanel,
1563
+ processMessage: n.processMessage,
1564
+ initializeContent: n.initializeContent,
1565
+ openArtifact: n.openArtifact,
1566
+ openFile: n.openFile,
1567
+ openCode: n.openCode,
1568
+ updateFile: n.updateFile,
1569
+ closePanel: n.closePanel,
1570
+ togglePanel: n.togglePanel,
1571
+ toggleFullscreen: n.toggleFullscreen,
1572
+ setViewMode: n.setViewMode,
1573
+ getPanelUrl: n.getPanelUrl,
1574
+ sendToPanel: n.sendToPanel,
1542
1575
  // Panel management
1543
- hasPanel: l.hasPanel,
1544
- registerPanel: u,
1576
+ hasPanel: n.hasPanel,
1577
+ registerPanel: $,
1545
1578
  unregisterPanel: h,
1546
- getPanelTypes: l.getPanelTypes,
1579
+ getPanelTypes: n.getPanelTypes,
1580
+ // Multi-tab
1581
+ closeTab: n.closeTab,
1582
+ closeOtherTabs: n.closeOtherTabs,
1583
+ closeAllTabs: n.closeAllTabs,
1547
1584
  // Events
1548
- on: l.on,
1549
- off: l.off,
1585
+ on: n.on,
1586
+ off: n.off,
1550
1587
  // State management
1551
- clearArtifacts: () => l.state.clear(),
1588
+ clearArtifacts: () => n.state.clear(),
1552
1589
  // Theme
1553
- applyTheme: l.applyTheme,
1554
- setTheme: L,
1555
- getTheme: l.getTheme
1590
+ applyTheme: n.applyTheme,
1591
+ setTheme: T,
1592
+ getTheme: n.getTheme
1556
1593
  }), [
1557
- l,
1558
- s,
1559
- x,
1594
+ n,
1560
1595
  i,
1596
+ x,
1597
+ o,
1561
1598
  k,
1562
- v,
1563
- S,
1564
- L,
1565
1599
  u,
1600
+ M,
1601
+ T,
1602
+ $,
1566
1603
  h
1567
1604
  ]);
1568
- return /* @__PURE__ */ e.createElement(ht.Provider, { value: C }, t);
1605
+ return /* @__PURE__ */ e.createElement(_t.Provider, { value: c }, t);
1569
1606
  }
1570
- function xe() {
1571
- const t = Ft(ht);
1607
+ function Me() {
1608
+ const t = zt(_t);
1572
1609
  if (!t)
1573
1610
  throw new Error("useArtifactuse must be used within an ArtifactuseProvider");
1574
1611
  return t;
1575
1612
  }
1576
- function oa(t, a) {
1577
- const { on: c, off: l } = xe();
1578
- j(() => {
1579
- const s = c(t, a);
1613
+ function da(t, a) {
1614
+ const { on: l, off: n } = Me();
1615
+ z(() => {
1616
+ const i = l(t, a);
1580
1617
  return () => {
1581
- typeof s == "function" ? s() : l(t, a);
1618
+ typeof i == "function" ? i() : n(t, a);
1582
1619
  };
1583
- }, [t, a, c, l]);
1620
+ }, [t, a, l, n]);
1584
1621
  }
1585
- function ua() {
1622
+ function fa() {
1586
1623
  const {
1587
1624
  registerPanel: t,
1588
1625
  unregisterPanel: a,
1589
- hasPanel: c,
1590
- panelTypes: l,
1591
- instance: s
1592
- } = xe(), r = d((p) => c({ type: p }), [c]), v = d((p, x = {}) => {
1593
- var i;
1594
- return ((i = s.panelResolver) == null ? void 0 : i.resolve(p, x)) || null;
1595
- }, [s]);
1626
+ hasPanel: l,
1627
+ panelTypes: n,
1628
+ instance: i
1629
+ } = Me(), m = p((r) => l({ type: r }), [l]), u = p((r, x = {}) => {
1630
+ var o;
1631
+ return ((o = i.panelResolver) == null ? void 0 : o.resolve(r, x)) || null;
1632
+ }, [i]);
1596
1633
  return {
1597
1634
  register: t,
1598
1635
  unregister: a,
1599
- isRegistered: r,
1600
- getPanelUrl: v,
1601
- types: l,
1602
- defaults: vt
1636
+ isRegistered: m,
1637
+ getPanelUrl: u,
1638
+ types: n,
1639
+ defaults: gt
1603
1640
  };
1604
1641
  }
1605
- const ha = {
1606
- ArtifactuseProvider: ia,
1607
- useArtifactuse: xe,
1608
- useArtifactuseEvent: oa,
1609
- usePanelRegistry: ua,
1610
- DEFAULT_PANELS: vt
1642
+ const ya = {
1643
+ ArtifactuseProvider: ma,
1644
+ useArtifactuse: Me,
1645
+ useArtifactuseEvent: da,
1646
+ usePanelRegistry: fa,
1647
+ DEFAULT_PANELS: gt
1611
1648
  };
1612
1649
  export {
1613
- ca as ArtifactuseAgentMessage,
1614
- Dt as ArtifactuseCard,
1615
- Ot as ArtifactuseInlineForm,
1616
- Ea as ArtifactusePanel,
1617
- va as ArtifactusePanelToggle,
1618
- ia as ArtifactuseProvider,
1619
- aa as ArtifactuseSocialPreview,
1620
- ra as ArtifactuseViewer,
1621
- vt as DEFAULT_PANELS,
1622
- ha as default,
1623
- xe as useArtifactuse,
1624
- oa as useArtifactuseEvent,
1625
- ua as usePanelRegistry
1650
+ ua as ArtifactuseAgentMessage,
1651
+ Ot as ArtifactuseCard,
1652
+ Zt as ArtifactuseInlineForm,
1653
+ ga as ArtifactusePanel,
1654
+ _a as ArtifactusePanelToggle,
1655
+ ma as ArtifactuseProvider,
1656
+ na as ArtifactuseSocialPreview,
1657
+ la as ArtifactuseViewer,
1658
+ gt as DEFAULT_PANELS,
1659
+ ya as default,
1660
+ Me as useArtifactuse,
1661
+ da as useArtifactuseEvent,
1662
+ fa as usePanelRegistry
1626
1663
  };