@react-grab/visual-edit 0.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js ADDED
@@ -0,0 +1,1462 @@
1
+ // ../react-grab/dist/chunk-ZX3YNVV2.js
2
+ var ea = (e, t) => e === t;
3
+ var kn = { equals: ea };
4
+ var Bo = Go;
5
+ var ze = 1;
6
+ var tn = 2;
7
+ var re = null;
8
+ var k = null;
9
+ var Dt = null;
10
+ var ue = null;
11
+ var Se = null;
12
+ var Le = null;
13
+ var _n = 0;
14
+ function R(e, t) {
15
+ t = t ? Object.assign({}, kn, t) : kn;
16
+ let n = { value: e, observers: null, observerSlots: null, comparator: t.equals || void 0 }, r = (i) => (typeof i == "function" && (i = i(n.value)), Uo(n, i));
17
+ return [Vo.bind(n), r];
18
+ }
19
+ function Oe(e) {
20
+ if (ue === null) return e();
21
+ let t = ue;
22
+ ue = null;
23
+ try {
24
+ return Dt ? Dt.untrack(e) : e();
25
+ } finally {
26
+ ue = t;
27
+ }
28
+ }
29
+ R(false);
30
+ function Vo() {
31
+ let e = k;
32
+ if (this.sources && this.state) if (this.state === ze) Ht(this);
33
+ else {
34
+ let t = Se;
35
+ Se = null, He(() => Tn(this)), Se = t;
36
+ }
37
+ if (ue) {
38
+ let t = this.observers ? this.observers.length : 0;
39
+ ue.sources ? (ue.sources.push(this), ue.sourceSlots.push(t)) : (ue.sources = [this], ue.sourceSlots = [t]), this.observers ? (this.observers.push(ue), this.observerSlots.push(ue.sources.length - 1)) : (this.observers = [ue], this.observerSlots = [ue.sources.length - 1]);
40
+ }
41
+ return e && k.sources.has(this) ? this.tValue : this.value;
42
+ }
43
+ function Uo(e, t, n) {
44
+ let r = e.value;
45
+ if (!e.comparator || !e.comparator(r, t)) {
46
+ e.value = t;
47
+ e.observers && e.observers.length && He(() => {
48
+ for (let i = 0; i < e.observers.length; i += 1) {
49
+ let o = e.observers[i], a = k && k.running;
50
+ a && k.disposed.has(o) || ((a ? !o.tState : !o.state) && (o.pure ? Se.push(o) : Le.push(o), o.observers && Ko(o)), a ? o.tState = ze : o.state = ze);
51
+ }
52
+ if (Se.length > 1e6) throw Se = [], new Error();
53
+ });
54
+ }
55
+ return t;
56
+ }
57
+ function Ht(e) {
58
+ if (!e.fn) return;
59
+ ht(e);
60
+ let t = _n;
61
+ Po(e, e.value, t);
62
+ }
63
+ function Po(e, t, n) {
64
+ let r, i = re, o = ue;
65
+ ue = re = e;
66
+ try {
67
+ r = e.fn(t);
68
+ } catch (a) {
69
+ return e.pure && (e.state = ze, e.owned && e.owned.forEach(ht), e.owned = null), e.updatedAt = n + 1, In(a);
70
+ } finally {
71
+ ue = o, re = i;
72
+ }
73
+ (!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? Uo(e, r) : e.value = r, e.updatedAt = n);
74
+ }
75
+ function rn(e) {
76
+ let t = k;
77
+ if (e.state === 0) return;
78
+ if (e.state === tn) return Tn(e);
79
+ if (e.suspense && Oe(e.suspense.inFallback)) return e.suspense.effects.push(e);
80
+ let n = [e];
81
+ for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < _n); ) {
82
+ e.state && n.push(e);
83
+ }
84
+ for (let r = n.length - 1; r >= 0; r--) {
85
+ if (e = n[r], t) ;
86
+ if (e.state === ze) Ht(e);
87
+ else if (e.state === tn) {
88
+ let i = Se;
89
+ Se = null, He(() => Tn(e, n[0])), Se = i;
90
+ }
91
+ }
92
+ }
93
+ function He(e, t) {
94
+ if (Se) return e();
95
+ let n = false;
96
+ (Se = []), Le ? n = true : Le = [], _n++;
97
+ try {
98
+ let r = e();
99
+ return ra(n), r;
100
+ } catch (r) {
101
+ n || (Le = null), Se = null, In(r);
102
+ }
103
+ }
104
+ function ra(e) {
105
+ if (Se && (Go(Se), Se = null), e) return;
106
+ let n = Le;
107
+ Le = null, n.length && He(() => Bo(n));
108
+ }
109
+ function Go(e) {
110
+ for (let t = 0; t < e.length; t++) rn(e[t]);
111
+ }
112
+ function Tn(e, t) {
113
+ e.state = 0;
114
+ for (let r = 0; r < e.sources.length; r += 1) {
115
+ let i = e.sources[r];
116
+ if (i.sources) {
117
+ let o = i.state;
118
+ o === ze ? i !== t && (!i.updatedAt || i.updatedAt < _n) && rn(i) : o === tn && Tn(i, t);
119
+ }
120
+ }
121
+ }
122
+ function Ko(e) {
123
+ for (let n = 0; n < e.observers.length; n += 1) {
124
+ let r = e.observers[n];
125
+ !r.state && (r.state = tn, r.pure ? Se.push(r) : Le.push(r), r.observers && Ko(r));
126
+ }
127
+ }
128
+ function ht(e) {
129
+ let t;
130
+ if (e.sources) for (; e.sources.length; ) {
131
+ let n = e.sources.pop(), r = e.sourceSlots.pop(), i = n.observers;
132
+ if (i && i.length) {
133
+ let o = i.pop(), a = n.observerSlots.pop();
134
+ r < i.length && (o.sourceSlots[a] = r, i[r] = o, n.observerSlots[r] = a);
135
+ }
136
+ }
137
+ if (e.tOwned) {
138
+ for (t = e.tOwned.length - 1; t >= 0; t--) ht(e.tOwned[t]);
139
+ delete e.tOwned;
140
+ }
141
+ if (e.owned) {
142
+ for (t = e.owned.length - 1; t >= 0; t--) ht(e.owned[t]);
143
+ e.owned = null;
144
+ }
145
+ if (e.cleanups) {
146
+ for (t = e.cleanups.length - 1; t >= 0; t--) e.cleanups[t]();
147
+ e.cleanups = null;
148
+ }
149
+ e.state = 0;
150
+ }
151
+ function En(e) {
152
+ return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", { cause: e });
153
+ }
154
+ function In(e, t = re) {
155
+ let r = En(e);
156
+ throw r;
157
+ }
158
+ var Xo = "_$DX_DELEGATE";
159
+ function G(e, t, n, r) {
160
+ let i, o = () => {
161
+ let l = document.createElement("template");
162
+ return l.innerHTML = e, l.content.firstChild;
163
+ }, a = () => (i || (i = o())).cloneNode(true);
164
+ return a.cloneNode = a, a;
165
+ }
166
+ function Mn(e, t = window.document) {
167
+ let n = t[Xo] || (t[Xo] = /* @__PURE__ */ new Set());
168
+ for (let r = 0, i = e.length; r < i; r++) {
169
+ let o = e[r];
170
+ n.has(o) || (n.add(o), t.addEventListener(o, ma));
171
+ }
172
+ }
173
+ function ma(e) {
174
+ let t = e.target, n = `$$${e.type}`, r = e.target, i = e.currentTarget, o = (c) => Object.defineProperty(e, "target", { configurable: true, value: c }), a = () => {
175
+ let c = t[n];
176
+ if (c && !t.disabled) {
177
+ let u = t[`${n}Data`];
178
+ if (u !== void 0 ? c.call(t, u, e) : c.call(t, e), e.cancelBubble) return;
179
+ }
180
+ return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) && o(t.host), true;
181
+ }, l = () => {
182
+ for (; a() && (t = t._$host || t.parentNode || t.host); ) ;
183
+ };
184
+ if (Object.defineProperty(e, "currentTarget", { configurable: true, get() {
185
+ return t || document;
186
+ } }), e.composedPath) {
187
+ let c = e.composedPath();
188
+ o(c[0]);
189
+ for (let u = 0; u < c.length - 2 && (t = c[u], !!a()); u++) {
190
+ if (t._$host) {
191
+ t = t._$host, l();
192
+ break;
193
+ }
194
+ if (t.parentNode === i) break;
195
+ }
196
+ } else l();
197
+ o(r);
198
+ }
199
+ var ni = "0.0.86";
200
+ var vr = "-";
201
+ var xa = (e) => {
202
+ let t = Ca(e), { conflictingClassGroups: n, conflictingClassGroupModifiers: r } = e;
203
+ return { getClassGroupId: (a) => {
204
+ let l = a.split(vr);
205
+ return l[0] === "" && l.length !== 1 && l.shift(), li(l, t) || va(a);
206
+ }, getConflictingClassGroupIds: (a, l) => {
207
+ let c = n[a] || [];
208
+ return l && r[a] ? [...c, ...r[a]] : c;
209
+ } };
210
+ };
211
+ var li = (e, t) => {
212
+ if (e.length === 0) return t.classGroupId;
213
+ let n = e[0], r = t.nextPart.get(n), i = r ? li(e.slice(1), r) : void 0;
214
+ if (i) return i;
215
+ if (t.validators.length === 0) return;
216
+ let o = e.join(vr);
217
+ return t.validators.find(({ validator: a }) => a(o))?.classGroupId;
218
+ };
219
+ var si = /^\[(.+)\]$/;
220
+ var va = (e) => {
221
+ if (si.test(e)) {
222
+ let t = si.exec(e)[1], n = t?.substring(0, t.indexOf(":"));
223
+ if (n) return "arbitrary.." + n;
224
+ }
225
+ };
226
+ var Ca = (e) => {
227
+ let { theme: t, prefix: n } = e, r = { nextPart: /* @__PURE__ */ new Map(), validators: [] };
228
+ return Ea(Object.entries(e.classGroups), n).forEach(([o, a]) => {
229
+ xr(a, r, o, t);
230
+ }), r;
231
+ };
232
+ var xr = (e, t, n, r) => {
233
+ e.forEach((i) => {
234
+ if (typeof i == "string") {
235
+ let o = i === "" ? t : ai(t, i);
236
+ o.classGroupId = n;
237
+ return;
238
+ }
239
+ if (typeof i == "function") {
240
+ if (Sa(i)) {
241
+ xr(i(r), t, n, r);
242
+ return;
243
+ }
244
+ t.validators.push({ validator: i, classGroupId: n });
245
+ return;
246
+ }
247
+ Object.entries(i).forEach(([o, a]) => {
248
+ xr(a, ai(t, o), n, r);
249
+ });
250
+ });
251
+ };
252
+ var ai = (e, t) => {
253
+ let n = e;
254
+ return t.split(vr).forEach((r) => {
255
+ n.nextPart.has(r) || n.nextPart.set(r, { nextPart: /* @__PURE__ */ new Map(), validators: [] }), n = n.nextPart.get(r);
256
+ }), n;
257
+ };
258
+ var Sa = (e) => e.isThemeGetter;
259
+ var Ea = (e, t) => t ? e.map(([n, r]) => {
260
+ let i = r.map((o) => typeof o == "string" ? t + o : typeof o == "object" ? Object.fromEntries(Object.entries(o).map(([a, l]) => [t + a, l])) : o);
261
+ return [n, i];
262
+ }) : e;
263
+ var ka = (e) => {
264
+ if (e < 1) return { get: () => {
265
+ }, set: () => {
266
+ } };
267
+ let t = 0, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = (o, a) => {
268
+ n.set(o, a), t++, t > e && (t = 0, r = n, n = /* @__PURE__ */ new Map());
269
+ };
270
+ return { get(o) {
271
+ let a = n.get(o);
272
+ if (a !== void 0) return a;
273
+ if ((a = r.get(o)) !== void 0) return i(o, a), a;
274
+ }, set(o, a) {
275
+ n.has(o) ? n.set(o, a) : i(o, a);
276
+ } };
277
+ };
278
+ var ci = "!";
279
+ var Ta = (e) => {
280
+ let { separator: t, experimentalParseClassName: n } = e, r = t.length === 1, i = t[0], o = t.length, a = (l) => {
281
+ let c = [], u = 0, h = 0, g;
282
+ for (let z = 0; z < l.length; z++) {
283
+ let q = l[z];
284
+ if (u === 0) {
285
+ if (q === i && (r || l.slice(z, z + o) === t)) {
286
+ c.push(l.slice(h, z)), h = z + o;
287
+ continue;
288
+ }
289
+ if (q === "/") {
290
+ g = z;
291
+ continue;
292
+ }
293
+ }
294
+ q === "[" ? u++ : q === "]" && u--;
295
+ }
296
+ let _ = c.length === 0 ? l : l.substring(h), w = _.startsWith(ci), v = w ? _.substring(1) : _, I = g && g > h ? g - h : void 0;
297
+ return { modifiers: c, hasImportantModifier: w, baseClassName: v, maybePostfixModifierPosition: I };
298
+ };
299
+ return n ? (l) => n({ className: l, parseClassName: a }) : a;
300
+ };
301
+ var Aa = (e) => {
302
+ if (e.length <= 1) return e;
303
+ let t = [], n = [];
304
+ return e.forEach((r) => {
305
+ r[0] === "[" ? (t.push(...n.sort(), r), n = []) : n.push(r);
306
+ }), t.push(...n.sort()), t;
307
+ };
308
+ var _a = (e) => ({ cache: ka(e.cacheSize), parseClassName: Ta(e), ...xa(e) });
309
+ var Na = /\s+/;
310
+ var Ra = (e, t) => {
311
+ let { parseClassName: n, getClassGroupId: r, getConflictingClassGroupIds: i } = t, o = [], a = e.trim().split(Na), l = "";
312
+ for (let c = a.length - 1; c >= 0; c -= 1) {
313
+ let u = a[c], { modifiers: h, hasImportantModifier: g, baseClassName: _, maybePostfixModifierPosition: w } = n(u), v = !!w, I = r(v ? _.substring(0, w) : _);
314
+ if (!I) {
315
+ if (!v) {
316
+ l = u + (l.length > 0 ? " " + l : l);
317
+ continue;
318
+ }
319
+ if (I = r(_), !I) {
320
+ l = u + (l.length > 0 ? " " + l : l);
321
+ continue;
322
+ }
323
+ v = false;
324
+ }
325
+ let z = Aa(h).join(":"), q = g ? z + ci : z, L = q + I;
326
+ if (o.includes(L)) continue;
327
+ o.push(L);
328
+ let j = i(I, v);
329
+ for (let Q = 0; Q < j.length; ++Q) {
330
+ let T = j[Q];
331
+ o.push(q + T);
332
+ }
333
+ l = u + (l.length > 0 ? " " + l : l);
334
+ }
335
+ return l;
336
+ };
337
+ function Ia() {
338
+ let e = 0, t, n, r = "";
339
+ for (; e < arguments.length; ) (t = arguments[e++]) && (n = ui(t)) && (r && (r += " "), r += n);
340
+ return r;
341
+ }
342
+ var ui = (e) => {
343
+ if (typeof e == "string") return e;
344
+ let t, n = "";
345
+ for (let r = 0; r < e.length; r++) e[r] && (t = ui(e[r])) && (n && (n += " "), n += t);
346
+ return n;
347
+ };
348
+ function La(e, ...t) {
349
+ let n, r, i, o = a;
350
+ function a(c) {
351
+ let u = t.reduce((h, g) => g(h), e());
352
+ return n = _a(u), r = n.cache.get, i = n.cache.set, o = l, l(c);
353
+ }
354
+ function l(c) {
355
+ let u = r(c);
356
+ if (u) return u;
357
+ let h = Ra(c, n);
358
+ return i(c, h), h;
359
+ }
360
+ return function() {
361
+ return o(Ia.apply(null, arguments));
362
+ };
363
+ }
364
+ var he = (e) => {
365
+ let t = (n) => n[e] || [];
366
+ return t.isThemeGetter = true, t;
367
+ };
368
+ var di = /^\[(?:([a-z-]+):)?(.+)\]$/i;
369
+ var Oa = /^\d+\/\d+$/;
370
+ var Ma = /* @__PURE__ */ new Set(["px", "full", "screen"]);
371
+ var $a = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
372
+ var Pa = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
373
+ var Fa = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
374
+ var Da = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
375
+ var Ba = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
376
+ var lt = (e) => Ut(e) || Ma.has(e) || Oa.test(e);
377
+ var wt = (e) => Gt(e, "length", Ya);
378
+ var Ut = (e) => !!e && !Number.isNaN(Number(e));
379
+ var wr = (e) => Gt(e, "number", Ut);
380
+ var sn = (e) => !!e && Number.isInteger(Number(e));
381
+ var Ha = (e) => e.endsWith("%") && Ut(e.slice(0, -1));
382
+ var Z = (e) => di.test(e);
383
+ var xt = (e) => $a.test(e);
384
+ var za = /* @__PURE__ */ new Set(["length", "size", "percentage"]);
385
+ var ja = (e) => Gt(e, za, fi);
386
+ var Va = (e) => Gt(e, "position", fi);
387
+ var Ua = /* @__PURE__ */ new Set(["image", "url"]);
388
+ var Ga = (e) => Gt(e, Ua, Wa);
389
+ var Ka = (e) => Gt(e, "", Xa);
390
+ var an = () => true;
391
+ var Gt = (e, t, n) => {
392
+ let r = di.exec(e);
393
+ return r ? r[1] ? typeof t == "string" ? r[1] === t : t.has(r[1]) : n(r[2]) : false;
394
+ };
395
+ var Ya = (e) => Pa.test(e) && !Fa.test(e);
396
+ var fi = () => false;
397
+ var Xa = (e) => Da.test(e);
398
+ var Wa = (e) => Ba.test(e);
399
+ var qa = () => {
400
+ let e = he("colors"), t = he("spacing"), n = he("blur"), r = he("brightness"), i = he("borderColor"), o = he("borderRadius"), a = he("borderSpacing"), l = he("borderWidth"), c = he("contrast"), u = he("grayscale"), h = he("hueRotate"), g = he("invert"), _ = he("gap"), w = he("gradientColorStops"), v = he("gradientColorStopPositions"), I = he("inset"), z = he("margin"), q = he("opacity"), L = he("padding"), j = he("saturate"), Q = he("scale"), T = he("sepia"), F = he("skew"), X = he("space"), V = he("translate"), W = () => ["auto", "contain", "none"], $ = () => ["auto", "hidden", "clip", "visible", "scroll"], p = () => ["auto", Z, t], m = () => [Z, t], f = () => ["", lt, wt], y = () => ["auto", Ut, Z], O = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], B = () => ["solid", "dashed", "dotted", "double", "none"], ne = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], te = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], ie = () => ["", "0", Z], C = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], P = () => [Ut, Z];
401
+ return { cacheSize: 500, separator: ":", theme: { colors: [an], spacing: [lt, wt], blur: ["none", "", xt, Z], brightness: P(), borderColor: [e], borderRadius: ["none", "", "full", xt, Z], borderSpacing: m(), borderWidth: f(), contrast: P(), grayscale: ie(), hueRotate: P(), invert: ie(), gap: m(), gradientColorStops: [e], gradientColorStopPositions: [Ha, wt], inset: p(), margin: p(), opacity: P(), padding: m(), saturate: P(), scale: P(), sepia: ie(), skew: P(), space: m(), translate: m() }, classGroups: { aspect: [{ aspect: ["auto", "square", "video", Z] }], container: ["container"], columns: [{ columns: [xt] }], "break-after": [{ "break-after": C() }], "break-before": [{ "break-before": C() }], "break-inside": [{ "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"] }], "box-decoration": [{ "box-decoration": ["slice", "clone"] }], box: [{ box: ["border", "content"] }], display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"], float: [{ float: ["right", "left", "none", "start", "end"] }], clear: [{ clear: ["left", "right", "both", "none", "start", "end"] }], isolation: ["isolate", "isolation-auto"], "object-fit": [{ object: ["contain", "cover", "fill", "none", "scale-down"] }], "object-position": [{ object: [...O(), Z] }], overflow: [{ overflow: $() }], "overflow-x": [{ "overflow-x": $() }], "overflow-y": [{ "overflow-y": $() }], overscroll: [{ overscroll: W() }], "overscroll-x": [{ "overscroll-x": W() }], "overscroll-y": [{ "overscroll-y": W() }], position: ["static", "fixed", "absolute", "relative", "sticky"], inset: [{ inset: [I] }], "inset-x": [{ "inset-x": [I] }], "inset-y": [{ "inset-y": [I] }], start: [{ start: [I] }], end: [{ end: [I] }], top: [{ top: [I] }], right: [{ right: [I] }], bottom: [{ bottom: [I] }], left: [{ left: [I] }], visibility: ["visible", "invisible", "collapse"], z: [{ z: ["auto", sn, Z] }], basis: [{ basis: p() }], "flex-direction": [{ flex: ["row", "row-reverse", "col", "col-reverse"] }], "flex-wrap": [{ flex: ["wrap", "wrap-reverse", "nowrap"] }], flex: [{ flex: ["1", "auto", "initial", "none", Z] }], grow: [{ grow: ie() }], shrink: [{ shrink: ie() }], order: [{ order: ["first", "last", "none", sn, Z] }], "grid-cols": [{ "grid-cols": [an] }], "col-start-end": [{ col: ["auto", { span: ["full", sn, Z] }, Z] }], "col-start": [{ "col-start": y() }], "col-end": [{ "col-end": y() }], "grid-rows": [{ "grid-rows": [an] }], "row-start-end": [{ row: ["auto", { span: [sn, Z] }, Z] }], "row-start": [{ "row-start": y() }], "row-end": [{ "row-end": y() }], "grid-flow": [{ "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"] }], "auto-cols": [{ "auto-cols": ["auto", "min", "max", "fr", Z] }], "auto-rows": [{ "auto-rows": ["auto", "min", "max", "fr", Z] }], gap: [{ gap: [_] }], "gap-x": [{ "gap-x": [_] }], "gap-y": [{ "gap-y": [_] }], "justify-content": [{ justify: ["normal", ...te()] }], "justify-items": [{ "justify-items": ["start", "end", "center", "stretch"] }], "justify-self": [{ "justify-self": ["auto", "start", "end", "center", "stretch"] }], "align-content": [{ content: ["normal", ...te(), "baseline"] }], "align-items": [{ items: ["start", "end", "center", "baseline", "stretch"] }], "align-self": [{ self: ["auto", "start", "end", "center", "stretch", "baseline"] }], "place-content": [{ "place-content": [...te(), "baseline"] }], "place-items": [{ "place-items": ["start", "end", "center", "baseline", "stretch"] }], "place-self": [{ "place-self": ["auto", "start", "end", "center", "stretch"] }], p: [{ p: [L] }], px: [{ px: [L] }], py: [{ py: [L] }], ps: [{ ps: [L] }], pe: [{ pe: [L] }], pt: [{ pt: [L] }], pr: [{ pr: [L] }], pb: [{ pb: [L] }], pl: [{ pl: [L] }], m: [{ m: [z] }], mx: [{ mx: [z] }], my: [{ my: [z] }], ms: [{ ms: [z] }], me: [{ me: [z] }], mt: [{ mt: [z] }], mr: [{ mr: [z] }], mb: [{ mb: [z] }], ml: [{ ml: [z] }], "space-x": [{ "space-x": [X] }], "space-x-reverse": ["space-x-reverse"], "space-y": [{ "space-y": [X] }], "space-y-reverse": ["space-y-reverse"], w: [{ w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", Z, t] }], "min-w": [{ "min-w": [Z, t, "min", "max", "fit"] }], "max-w": [{ "max-w": [Z, t, "none", "full", "min", "max", "fit", "prose", { screen: [xt] }, xt] }], h: [{ h: [Z, t, "auto", "min", "max", "fit", "svh", "lvh", "dvh"] }], "min-h": [{ "min-h": [Z, t, "min", "max", "fit", "svh", "lvh", "dvh"] }], "max-h": [{ "max-h": [Z, t, "min", "max", "fit", "svh", "lvh", "dvh"] }], size: [{ size: [Z, t, "auto", "min", "max", "fit"] }], "font-size": [{ text: ["base", xt, wt] }], "font-smoothing": ["antialiased", "subpixel-antialiased"], "font-style": ["italic", "not-italic"], "font-weight": [{ font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", wr] }], "font-family": [{ font: [an] }], "fvn-normal": ["normal-nums"], "fvn-ordinal": ["ordinal"], "fvn-slashed-zero": ["slashed-zero"], "fvn-figure": ["lining-nums", "oldstyle-nums"], "fvn-spacing": ["proportional-nums", "tabular-nums"], "fvn-fraction": ["diagonal-fractions", "stacked-fractions"], tracking: [{ tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", Z] }], "line-clamp": [{ "line-clamp": ["none", Ut, wr] }], leading: [{ leading: ["none", "tight", "snug", "normal", "relaxed", "loose", lt, Z] }], "list-image": [{ "list-image": ["none", Z] }], "list-style-type": [{ list: ["none", "disc", "decimal", Z] }], "list-style-position": [{ list: ["inside", "outside"] }], "placeholder-color": [{ placeholder: [e] }], "placeholder-opacity": [{ "placeholder-opacity": [q] }], "text-alignment": [{ text: ["left", "center", "right", "justify", "start", "end"] }], "text-color": [{ text: [e] }], "text-opacity": [{ "text-opacity": [q] }], "text-decoration": ["underline", "overline", "line-through", "no-underline"], "text-decoration-style": [{ decoration: [...B(), "wavy"] }], "text-decoration-thickness": [{ decoration: ["auto", "from-font", lt, wt] }], "underline-offset": [{ "underline-offset": ["auto", lt, Z] }], "text-decoration-color": [{ decoration: [e] }], "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"], "text-overflow": ["truncate", "text-ellipsis", "text-clip"], "text-wrap": [{ text: ["wrap", "nowrap", "balance", "pretty"] }], indent: [{ indent: m() }], "vertical-align": [{ align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", Z] }], whitespace: [{ whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"] }], break: [{ break: ["normal", "words", "all", "keep"] }], hyphens: [{ hyphens: ["none", "manual", "auto"] }], content: [{ content: ["none", Z] }], "bg-attachment": [{ bg: ["fixed", "local", "scroll"] }], "bg-clip": [{ "bg-clip": ["border", "padding", "content", "text"] }], "bg-opacity": [{ "bg-opacity": [q] }], "bg-origin": [{ "bg-origin": ["border", "padding", "content"] }], "bg-position": [{ bg: [...O(), Va] }], "bg-repeat": [{ bg: ["no-repeat", { repeat: ["", "x", "y", "round", "space"] }] }], "bg-size": [{ bg: ["auto", "cover", "contain", ja] }], "bg-image": [{ bg: ["none", { "gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"] }, Ga] }], "bg-color": [{ bg: [e] }], "gradient-from-pos": [{ from: [v] }], "gradient-via-pos": [{ via: [v] }], "gradient-to-pos": [{ to: [v] }], "gradient-from": [{ from: [w] }], "gradient-via": [{ via: [w] }], "gradient-to": [{ to: [w] }], rounded: [{ rounded: [o] }], "rounded-s": [{ "rounded-s": [o] }], "rounded-e": [{ "rounded-e": [o] }], "rounded-t": [{ "rounded-t": [o] }], "rounded-r": [{ "rounded-r": [o] }], "rounded-b": [{ "rounded-b": [o] }], "rounded-l": [{ "rounded-l": [o] }], "rounded-ss": [{ "rounded-ss": [o] }], "rounded-se": [{ "rounded-se": [o] }], "rounded-ee": [{ "rounded-ee": [o] }], "rounded-es": [{ "rounded-es": [o] }], "rounded-tl": [{ "rounded-tl": [o] }], "rounded-tr": [{ "rounded-tr": [o] }], "rounded-br": [{ "rounded-br": [o] }], "rounded-bl": [{ "rounded-bl": [o] }], "border-w": [{ border: [l] }], "border-w-x": [{ "border-x": [l] }], "border-w-y": [{ "border-y": [l] }], "border-w-s": [{ "border-s": [l] }], "border-w-e": [{ "border-e": [l] }], "border-w-t": [{ "border-t": [l] }], "border-w-r": [{ "border-r": [l] }], "border-w-b": [{ "border-b": [l] }], "border-w-l": [{ "border-l": [l] }], "border-opacity": [{ "border-opacity": [q] }], "border-style": [{ border: [...B(), "hidden"] }], "divide-x": [{ "divide-x": [l] }], "divide-x-reverse": ["divide-x-reverse"], "divide-y": [{ "divide-y": [l] }], "divide-y-reverse": ["divide-y-reverse"], "divide-opacity": [{ "divide-opacity": [q] }], "divide-style": [{ divide: B() }], "border-color": [{ border: [i] }], "border-color-x": [{ "border-x": [i] }], "border-color-y": [{ "border-y": [i] }], "border-color-s": [{ "border-s": [i] }], "border-color-e": [{ "border-e": [i] }], "border-color-t": [{ "border-t": [i] }], "border-color-r": [{ "border-r": [i] }], "border-color-b": [{ "border-b": [i] }], "border-color-l": [{ "border-l": [i] }], "divide-color": [{ divide: [i] }], "outline-style": [{ outline: ["", ...B()] }], "outline-offset": [{ "outline-offset": [lt, Z] }], "outline-w": [{ outline: [lt, wt] }], "outline-color": [{ outline: [e] }], "ring-w": [{ ring: f() }], "ring-w-inset": ["ring-inset"], "ring-color": [{ ring: [e] }], "ring-opacity": [{ "ring-opacity": [q] }], "ring-offset-w": [{ "ring-offset": [lt, wt] }], "ring-offset-color": [{ "ring-offset": [e] }], shadow: [{ shadow: ["", "inner", "none", xt, Ka] }], "shadow-color": [{ shadow: [an] }], opacity: [{ opacity: [q] }], "mix-blend": [{ "mix-blend": [...ne(), "plus-lighter", "plus-darker"] }], "bg-blend": [{ "bg-blend": ne() }], filter: [{ filter: ["", "none"] }], blur: [{ blur: [n] }], brightness: [{ brightness: [r] }], contrast: [{ contrast: [c] }], "drop-shadow": [{ "drop-shadow": ["", "none", xt, Z] }], grayscale: [{ grayscale: [u] }], "hue-rotate": [{ "hue-rotate": [h] }], invert: [{ invert: [g] }], saturate: [{ saturate: [j] }], sepia: [{ sepia: [T] }], "backdrop-filter": [{ "backdrop-filter": ["", "none"] }], "backdrop-blur": [{ "backdrop-blur": [n] }], "backdrop-brightness": [{ "backdrop-brightness": [r] }], "backdrop-contrast": [{ "backdrop-contrast": [c] }], "backdrop-grayscale": [{ "backdrop-grayscale": [u] }], "backdrop-hue-rotate": [{ "backdrop-hue-rotate": [h] }], "backdrop-invert": [{ "backdrop-invert": [g] }], "backdrop-opacity": [{ "backdrop-opacity": [q] }], "backdrop-saturate": [{ "backdrop-saturate": [j] }], "backdrop-sepia": [{ "backdrop-sepia": [T] }], "border-collapse": [{ border: ["collapse", "separate"] }], "border-spacing": [{ "border-spacing": [a] }], "border-spacing-x": [{ "border-spacing-x": [a] }], "border-spacing-y": [{ "border-spacing-y": [a] }], "table-layout": [{ table: ["auto", "fixed"] }], caption: [{ caption: ["top", "bottom"] }], transition: [{ transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", Z] }], duration: [{ duration: P() }], ease: [{ ease: ["linear", "in", "out", "in-out", Z] }], delay: [{ delay: P() }], animate: [{ animate: ["none", "spin", "ping", "pulse", "bounce", Z] }], transform: [{ transform: ["", "gpu", "none"] }], scale: [{ scale: [Q] }], "scale-x": [{ "scale-x": [Q] }], "scale-y": [{ "scale-y": [Q] }], rotate: [{ rotate: [sn, Z] }], "translate-x": [{ "translate-x": [V] }], "translate-y": [{ "translate-y": [V] }], "skew-x": [{ "skew-x": [F] }], "skew-y": [{ "skew-y": [F] }], "transform-origin": [{ origin: ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", Z] }], accent: [{ accent: ["auto", e] }], appearance: [{ appearance: ["none", "auto"] }], cursor: [{ cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", Z] }], "caret-color": [{ caret: [e] }], "pointer-events": [{ "pointer-events": ["none", "auto"] }], resize: [{ resize: ["none", "y", "x", ""] }], "scroll-behavior": [{ scroll: ["auto", "smooth"] }], "scroll-m": [{ "scroll-m": m() }], "scroll-mx": [{ "scroll-mx": m() }], "scroll-my": [{ "scroll-my": m() }], "scroll-ms": [{ "scroll-ms": m() }], "scroll-me": [{ "scroll-me": m() }], "scroll-mt": [{ "scroll-mt": m() }], "scroll-mr": [{ "scroll-mr": m() }], "scroll-mb": [{ "scroll-mb": m() }], "scroll-ml": [{ "scroll-ml": m() }], "scroll-p": [{ "scroll-p": m() }], "scroll-px": [{ "scroll-px": m() }], "scroll-py": [{ "scroll-py": m() }], "scroll-ps": [{ "scroll-ps": m() }], "scroll-pe": [{ "scroll-pe": m() }], "scroll-pt": [{ "scroll-pt": m() }], "scroll-pr": [{ "scroll-pr": m() }], "scroll-pb": [{ "scroll-pb": m() }], "scroll-pl": [{ "scroll-pl": m() }], "snap-align": [{ snap: ["start", "end", "center", "align-none"] }], "snap-stop": [{ snap: ["normal", "always"] }], "snap-type": [{ snap: ["none", "x", "y", "both"] }], "snap-strictness": [{ snap: ["mandatory", "proximity"] }], touch: [{ touch: ["auto", "none", "manipulation"] }], "touch-x": [{ "touch-pan": ["x", "left", "right"] }], "touch-y": [{ "touch-pan": ["y", "up", "down"] }], "touch-pz": ["touch-pinch-zoom"], select: [{ select: ["none", "text", "all", "auto"] }], "will-change": [{ "will-change": ["auto", "scroll", "contents", "transform", Z] }], fill: [{ fill: [e, "none"] }], "stroke-w": [{ stroke: [lt, wt, wr] }], stroke: [{ stroke: [e, "none"] }], sr: ["sr-only", "not-sr-only"], "forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }] }, conflictingClassGroups: { overflow: ["overflow-x", "overflow-y"], overscroll: ["overscroll-x", "overscroll-y"], inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"], "inset-x": ["right", "left"], "inset-y": ["top", "bottom"], flex: ["basis", "grow", "shrink"], gap: ["gap-x", "gap-y"], p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"], px: ["pr", "pl"], py: ["pt", "pb"], m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"], mx: ["mr", "ml"], my: ["mt", "mb"], size: ["w", "h"], "font-size": ["leading"], "fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"], "fvn-ordinal": ["fvn-normal"], "fvn-slashed-zero": ["fvn-normal"], "fvn-figure": ["fvn-normal"], "fvn-spacing": ["fvn-normal"], "fvn-fraction": ["fvn-normal"], "line-clamp": ["display", "overflow"], rounded: ["rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"], "rounded-s": ["rounded-ss", "rounded-es"], "rounded-e": ["rounded-se", "rounded-ee"], "rounded-t": ["rounded-tl", "rounded-tr"], "rounded-r": ["rounded-tr", "rounded-br"], "rounded-b": ["rounded-br", "rounded-bl"], "rounded-l": ["rounded-tl", "rounded-bl"], "border-spacing": ["border-spacing-x", "border-spacing-y"], "border-w": ["border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"], "border-w-x": ["border-w-r", "border-w-l"], "border-w-y": ["border-w-t", "border-w-b"], "border-color": ["border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"], "border-color-x": ["border-color-r", "border-color-l"], "border-color-y": ["border-color-t", "border-color-b"], "scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"], "scroll-mx": ["scroll-mr", "scroll-ml"], "scroll-my": ["scroll-mt", "scroll-mb"], "scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"], "scroll-px": ["scroll-pr", "scroll-pl"], "scroll-py": ["scroll-pt", "scroll-pb"], touch: ["touch-x", "touch-y", "touch-pz"], "touch-x": ["touch"], "touch-y": ["touch"], "touch-pz": ["touch"] }, conflictingClassGroupModifiers: { "font-size": ["leading"] } };
402
+ };
403
+ La(qa);
404
+ G("<div style=overflow:visible>");
405
+ G('<canvas class="fixed top-0 left-0 pointer-events-none z-[2147483645]">');
406
+ G('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2><path d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6"></path><path d="M11 13l9-9"></path><path d="M15 4h5v5">');
407
+ G('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1=12 x2=12 y1=19 y2=22>');
408
+ G('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 22 19"fill=none><path d="M6.76263 18.6626C7.48251 18.6626 7.95474 18.1682 7.95474 17.4895C7.95474 17.1207 7.80474 16.8576 7.58683 16.6361L5.3018 14.4137L2.84621 12.3589L2.44374 13.0037L5.92137 13.1622H17.9232C20.4842 13.1622 21.593 12.021 21.593 9.47237V3.66983C21.593 1.10875 20.4842 0 17.9232 0H12.5414C11.8179 0 11.3018 0.545895 11.3018 1.21695C11.3018 1.888 11.8179 2.43389 12.5414 2.43389H17.8424C18.7937 2.43389 19.1897 2.83653 19.1897 3.78784V9.35747C19.1897 10.3257 18.7937 10.7314 17.8424 10.7314H5.92137L2.44374 10.8832L2.84621 11.5281L5.3018 9.47993L7.58683 7.2606C7.80474 7.03914 7.95474 6.7693 7.95474 6.40049C7.95474 5.72854 7.48251 5.22747 6.76263 5.22747C6.46129 5.22747 6.12975 5.36905 5.89231 5.6096L0.376815 11.0425C0.134921 11.2777 0 11.6141 0 11.9452C0 12.2728 0.134921 12.6158 0.376815 12.848L5.89231 18.2871C6.12975 18.5276 6.46129 18.6626 6.76263 18.6626Z"fill=currentColor>');
409
+ G('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none><path d="M17.65 6.35C16.2 4.9 14.21 4 12 4C7.58 4 4.01 7.58 4.01 12C4.01 16.42 7.58 20 12 20C15.73 20 18.84 17.45 19.73 14H17.65C16.83 16.33 14.61 18 12 18C8.69 18 6 15.31 6 12C6 8.69 8.69 6 12 6C13.66 6 15.14 6.69 16.22 7.78L13 11H20V4L17.65 6.35Z"fill=currentColor>');
410
+ G('<div style="background-image:linear-gradient(in oklab 180deg, oklab(88.7% 0.086 -0.058) 0%, oklab(83.2% 0.132 -0.089) 100%)"><span>');
411
+ G('<div class="contain-layout shrink-0 flex items-center w-fit h-4 rounded-[1px] gap-1 px-[3px] [border-width:0.5px] border-solid border-[#B3B3B3] py-0 bg-[#F7F7F7]"><span class="text-[#0C0C0C] text-[11.5px] leading-3.5 shrink-0 font-medium w-fit h-fit">');
412
+ G('<div class="contain-layout shrink-0 flex items-center w-fit h-4 rounded-[1px] gap-1 px-[3px] [border-width:0.5px] border-solid border-white py-0"><span class="text-[#0C0C0C] text-[11.5px] leading-3.5 shrink-0 font-medium w-fit h-fit">&gt;');
413
+ G('<div class="absolute w-0 h-0"style="border-left:8px solid transparent;border-right:8px solid transparent">');
414
+ G('<div role=button><div class="text-black text-[12px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">');
415
+ G('<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-[5px] w-auto h-fit self-stretch [border-top-width:0.5px] border-t-solid border-t-[#D9D9D9] antialiased rounded-t-none rounded-b-xs -mt-px"style="background-image:linear-gradient(in oklab 180deg, oklab(100% 0 0) 0%, oklab(96.1% 0 0) 5.92%)">');
416
+ G('<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit"><button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[11px] leading-3.5 font-sans font-medium">No</span></button><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-xs bg-white [border-width:0.5px] border-solid border-[#7e0002] cursor-pointer transition-all hover:bg-[#FEF2F2] h-[17px]"><span class="text-[#B91C1C] text-[11px] leading-3.5 font-sans font-medium">Yes');
417
+ G('<div class="contain-layout shrink-0 flex flex-col justify-center items-end gap-1 w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-full h-fit"><span class="text-black text-[12px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">Discard?');
418
+ G('<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit"><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[11px] leading-3.5 font-sans font-medium">Retry</span></button><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[11px] leading-3.5 font-sans font-medium">Ok');
419
+ G('<div class="contain-layout shrink-0 flex flex-col justify-center items-end gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-full h-fit"><span class="text-[#B91C1C] text-[12px] leading-4 font-sans font-medium">');
420
+ G('<button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-xs bg-white [border-width:0.5px] border-solid border-[#7e0002] cursor-pointer transition-all hover:bg-[#FEF2F2] h-[17px]"><span class="text-[#B91C1C] text-[11px] leading-3.5 font-sans font-medium">Undo');
421
+ G('<button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[11px] leading-3.5 font-sans font-medium">Reply');
422
+ G('<button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[11px] leading-3.5 font-sans font-medium">');
423
+ G('<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit">');
424
+ G('<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col justify-center items-end rounded-xs bg-white antialiased w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 px-1.5 w-full h-fit"><span class="text-black text-[12px] leading-4 shrink-0 font-sans font-medium w-fit h-fit tabular-nums">');
425
+ G('<button data-react-grab-ignore-events class="contain-layout shrink-0 flex flex-col items-start rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] p-1 size-fit cursor-pointer ml-1 transition-none hover:scale-105"><div data-react-grab-ignore-events class="shrink-0 w-[7px] h-[7px] rounded-[1px] bg-black pointer-events-none">');
426
+ G('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[12px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 opacity-50 wrap-break-word overflow-y-auto"placeholder="type to edit"rows=1 disabled style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none>');
427
+ G('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-auto h-fit"><div class="contain-layout flex items-center px-0 py-px w-auto h-fit rounded-[1.5px] gap-[3px]"><span class="text-[12px] leading-4 font-sans font-medium w-auto h-fit whitespace-normal text-[#71717a] animate-pulse tabular-nums">');
428
+ G('<div class="contain-layout shrink-0 flex items-center gap-px w-fit h-fit">');
429
+ G('<span class="text-label-muted text-[12px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">Double click to edit');
430
+ G('<div class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit">');
431
+ G('<span class="text-label-muted text-[12px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">Press');
432
+ G('<div class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-[2px] rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit"><span class="text-[9px] leading-none font-medium text-black">Esc');
433
+ G('<span class="text-label-muted text-[12px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">to dismiss');
434
+ G('<div class="contain-layout shrink-0 flex items-center gap-1 w-fit h-fit">');
435
+ G('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit"><div></div><div class="grid transition-[grid-template-rows] duration-30 ease-out self-stretch"><div>');
436
+ G('<div class="shrink-0 flex items-center gap-0.5 w-full mb-0.5 overflow-hidden"><span class="text-[#a1a1aa] text-[9px] leading-3 shrink-0">>previously:</span><span class="text-[#a1a1aa] text-[9px] leading-3 italic truncate whitespace-nowrap">');
437
+ G("<button>");
438
+ G('<button class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-xs bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit cursor-pointer transition-all hover:scale-105">');
439
+ G('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[12px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none></textarea><div class="flex items-center gap-0.5 ml-1 w-[17px] h-[17px] justify-end">');
440
+ G('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div>');
441
+ G('<div data-react-grab-ignore-events class="fixed font-sans antialiased transition-opacity duration-300 ease-out filter-[drop-shadow(0px_0px_4px_#51515180)] select-none"style=z-index:2147483647><div class="[font-synthesis:none] contain-layout flex items-center gap-[5px] rounded-xs bg-white antialiased w-fit h-fit p-0">');
442
+ Mn(["click", "pointerdown", "mousedown", "pointerup", "input", "keydown"]);
443
+ G('<div class="fixed z-2147483647"><button data-react-grab-selection-cursor>');
444
+ Mn(["click"]);
445
+ var Li = "0.5.25";
446
+ var Hn = `bippy-${Li}`;
447
+ var Ri = Object.defineProperty;
448
+ var zl = Object.prototype.hasOwnProperty;
449
+ var cn = () => {
450
+ };
451
+ var Oi = (e) => {
452
+ try {
453
+ Function.prototype.toString.call(e).indexOf("^_^") > -1 && setTimeout(() => {
454
+ throw Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build");
455
+ });
456
+ } catch {
457
+ }
458
+ };
459
+ var zn = (e = ct()) => "getFiberRoots" in e;
460
+ var Mi = false;
461
+ var Ii;
462
+ var un = (e = ct()) => Mi ? true : (typeof e.inject == "function" && (Ii = e.inject.toString()), !!Ii?.includes("(injected)"));
463
+ var Dn = /* @__PURE__ */ new Set();
464
+ var Rt = /* @__PURE__ */ new Set();
465
+ var $i = (e) => {
466
+ let t = /* @__PURE__ */ new Map(), n = 0, r = { _instrumentationIsActive: false, _instrumentationSource: Hn, checkDCE: Oi, hasUnsupportedRendererAttached: false, inject(i) {
467
+ let o = ++n;
468
+ return t.set(o, i), Rt.add(i), r._instrumentationIsActive || (r._instrumentationIsActive = true, Dn.forEach((a) => a())), o;
469
+ }, on: cn, onCommitFiberRoot: cn, onCommitFiberUnmount: cn, onPostCommitFiberRoot: cn, renderers: t, supportsFiber: true, supportsFlight: true };
470
+ try {
471
+ Ri(globalThis, "__REACT_DEVTOOLS_GLOBAL_HOOK__", { configurable: true, enumerable: true, get() {
472
+ return r;
473
+ }, set(a) {
474
+ if (a && typeof a == "object") {
475
+ let l = r.renderers;
476
+ r = a, l.size > 0 && (l.forEach((c, u) => {
477
+ Rt.add(c), a.renderers.set(u, c);
478
+ }), Bn(e));
479
+ }
480
+ } });
481
+ let i = window.hasOwnProperty, o = false;
482
+ Ri(window, "hasOwnProperty", { configurable: true, value: function(...a) {
483
+ try {
484
+ if (!o && a[0] === "__REACT_DEVTOOLS_GLOBAL_HOOK__") return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__ = void 0, o = true, -0;
485
+ } catch {
486
+ }
487
+ return i.apply(this, a);
488
+ }, writable: true });
489
+ } catch {
490
+ Bn(e);
491
+ }
492
+ return r;
493
+ };
494
+ var Bn = (e) => {
495
+ try {
496
+ let t = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
497
+ if (!t) return;
498
+ if (!t._instrumentationSource) {
499
+ t.checkDCE = Oi, t.supportsFiber = true, t.supportsFlight = true, t.hasUnsupportedRendererAttached = false, t._instrumentationSource = Hn, t._instrumentationIsActive = false;
500
+ let n = zn(t);
501
+ if (n || (t.on = cn), t.renderers.size) {
502
+ t._instrumentationIsActive = true, Dn.forEach((o) => o());
503
+ return;
504
+ }
505
+ let r = t.inject, i = un(t);
506
+ i && !n && (Mi = true, t.inject({ scheduleRefresh() {
507
+ } }) && (t._instrumentationIsActive = true)), t.inject = (o) => {
508
+ let a = r(o);
509
+ return Rt.add(o), i && t.renderers.set(a, o), t._instrumentationIsActive = true, Dn.forEach((l) => l()), a;
510
+ };
511
+ }
512
+ (t.renderers.size || t._instrumentationIsActive || un()) && e?.();
513
+ } catch {
514
+ }
515
+ };
516
+ var Cr = () => zl.call(globalThis, "__REACT_DEVTOOLS_GLOBAL_HOOK__");
517
+ var ct = (e) => Cr() ? (Bn(e), globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__) : $i(e);
518
+ var Pi = () => !!(typeof window < "u" && (window.document?.createElement || window.navigator?.product === "ReactNative"));
519
+ var Sr = () => {
520
+ try {
521
+ Pi() && ct();
522
+ } catch {
523
+ }
524
+ };
525
+ var ql = Object.create;
526
+ var Ui = Object.defineProperty;
527
+ var Zl = Object.getOwnPropertyDescriptor;
528
+ var Jl = Object.getOwnPropertyNames;
529
+ var Ql = Object.getPrototypeOf;
530
+ var ec = Object.prototype.hasOwnProperty;
531
+ var tc = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
532
+ var nc = (e, t, n, r) => {
533
+ if (t && typeof t == "object" || typeof t == "function") for (var i = Jl(t), o = 0, a = i.length, l; o < a; o++) l = i[o], !ec.call(e, l) && l !== n && Ui(e, l, { get: ((c) => t[c]).bind(null, l), enumerable: !(r = Zl(t, l)) || r.enumerable });
534
+ return e;
535
+ };
536
+ var rc = (e, t, n) => (n = e == null ? {} : ql(Ql(e)), nc(Ui(n, "default", { value: e, enumerable: true }), e));
537
+ var dc = tc((e, t) => {
538
+ (function(n, r) {
539
+ typeof e == "object" && t !== void 0 ? r(e) : typeof define == "function" && define.amd ? define(["exports"], r) : (n = typeof globalThis < "u" ? globalThis : n || self, r(n.sourcemapCodec = {}));
540
+ })(void 0, function(n) {
541
+ let r = 44, i = 59, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a = new Uint8Array(64), l = new Uint8Array(128);
542
+ for (let p = 0; p < o.length; p++) {
543
+ let m = o.charCodeAt(p);
544
+ a[p] = m, l[m] = p;
545
+ }
546
+ function c(p, m) {
547
+ let f = 0, y = 0, O = 0;
548
+ do {
549
+ let ne = p.next();
550
+ O = l[ne], f |= (O & 31) << y, y += 5;
551
+ } while (O & 32);
552
+ let B = f & 1;
553
+ return f >>>= 1, B && (f = -2147483648 | -f), m + f;
554
+ }
555
+ function u(p, m, f) {
556
+ let y = m - f;
557
+ y = y < 0 ? -y << 1 | 1 : y << 1;
558
+ do {
559
+ let O = y & 31;
560
+ y >>>= 5, y > 0 && (O |= 32), p.write(a[O]);
561
+ } while (y > 0);
562
+ return m;
563
+ }
564
+ function h(p, m) {
565
+ return p.pos >= m ? false : p.peek() !== r;
566
+ }
567
+ let g = 1024 * 16, _ = typeof TextDecoder < "u" ? new TextDecoder() : typeof Buffer < "u" ? { decode(p) {
568
+ return Buffer.from(p.buffer, p.byteOffset, p.byteLength).toString();
569
+ } } : { decode(p) {
570
+ let m = "";
571
+ for (let f = 0; f < p.length; f++) m += String.fromCharCode(p[f]);
572
+ return m;
573
+ } };
574
+ class w {
575
+ constructor() {
576
+ this.pos = 0, this.out = "", this.buffer = new Uint8Array(g);
577
+ }
578
+ write(m) {
579
+ let { buffer: f } = this;
580
+ f[this.pos++] = m, this.pos === g && (this.out += _.decode(f), this.pos = 0);
581
+ }
582
+ flush() {
583
+ let { buffer: m, out: f, pos: y } = this;
584
+ return y > 0 ? f + _.decode(m.subarray(0, y)) : f;
585
+ }
586
+ }
587
+ class v {
588
+ constructor(m) {
589
+ this.pos = 0, this.buffer = m;
590
+ }
591
+ next() {
592
+ return this.buffer.charCodeAt(this.pos++);
593
+ }
594
+ peek() {
595
+ return this.buffer.charCodeAt(this.pos);
596
+ }
597
+ indexOf(m) {
598
+ let { buffer: f, pos: y } = this, O = f.indexOf(m, y);
599
+ return O === -1 ? f.length : O;
600
+ }
601
+ }
602
+ let I = [];
603
+ function z(p) {
604
+ let { length: m } = p, f = new v(p), y = [], O = [], B = 0;
605
+ for (; f.pos < m; f.pos++) {
606
+ B = c(f, B);
607
+ let ne = c(f, 0);
608
+ if (!h(f, m)) {
609
+ let Y = O.pop();
610
+ Y[2] = B, Y[3] = ne;
611
+ continue;
612
+ }
613
+ let te = c(f, 0), ie = c(f, 0), C = ie & 1, P = C ? [B, ne, 0, 0, te, c(f, 0)] : [B, ne, 0, 0, te], K = I;
614
+ if (h(f, m)) {
615
+ K = [];
616
+ do {
617
+ let Y = c(f, 0);
618
+ K.push(Y);
619
+ } while (h(f, m));
620
+ }
621
+ P.vars = K, y.push(P), O.push(P);
622
+ }
623
+ return y;
624
+ }
625
+ function q(p) {
626
+ let m = new w();
627
+ for (let f = 0; f < p.length; ) f = L(p, f, m, [0]);
628
+ return m.flush();
629
+ }
630
+ function L(p, m, f, y) {
631
+ let O = p[m], { 0: B, 1: ne, 2: te, 3: ie, 4: C, vars: P } = O;
632
+ m > 0 && f.write(r), y[0] = u(f, B, y[0]), u(f, ne, 0), u(f, C, 0);
633
+ let K = O.length === 6 ? 1 : 0;
634
+ u(f, K, 0), O.length === 6 && u(f, O[5], 0);
635
+ for (let Y of P) u(f, Y, 0);
636
+ for (m++; m < p.length; ) {
637
+ let Y = p[m], { 0: U, 1: H } = Y;
638
+ if (U > te || U === te && H >= ie) break;
639
+ m = L(p, m, f, y);
640
+ }
641
+ return f.write(r), y[0] = u(f, te, y[0]), u(f, ie, 0), m;
642
+ }
643
+ function j(p) {
644
+ let { length: m } = p, f = new v(p), y = [], O = [], B = 0, ne = 0, te = 0, ie = 0, C = 0, P = 0, K = 0, Y = 0;
645
+ do {
646
+ let U = f.indexOf(";"), H = 0;
647
+ for (; f.pos < U; f.pos++) {
648
+ if (H = c(f, H), !h(f, U)) {
649
+ let ve = O.pop();
650
+ ve[2] = B, ve[3] = H;
651
+ continue;
652
+ }
653
+ let se = c(f, 0), ee = se & 1, fe = se & 2, me = se & 4, we = null, ge = I, ke;
654
+ if (ee) {
655
+ let ve = c(f, ne);
656
+ te = c(f, ne === ve ? te : 0), ne = ve, ke = [B, H, 0, 0, ve, te];
657
+ } else ke = [B, H, 0, 0];
658
+ if (ke.isScope = !!me, fe) {
659
+ let ve = ie, nt = C;
660
+ ie = c(f, ie);
661
+ let Fe = ve === ie;
662
+ C = c(f, Fe ? C : 0), P = c(f, Fe && nt === C ? P : 0), we = [ie, C, P];
663
+ }
664
+ if (ke.callsite = we, h(f, U)) {
665
+ ge = [];
666
+ do {
667
+ K = B, Y = H;
668
+ let ve = c(f, 0), nt;
669
+ if (ve < -1) {
670
+ nt = [[c(f, 0)]];
671
+ for (let Fe = -1; Fe > ve; Fe--) {
672
+ let Ve = K;
673
+ K = c(f, K), Y = c(f, K === Ve ? Y : 0);
674
+ let Wt = c(f, 0);
675
+ nt.push([Wt, K, Y]);
676
+ }
677
+ } else nt = [[ve]];
678
+ ge.push(nt);
679
+ } while (h(f, U));
680
+ }
681
+ ke.bindings = ge, y.push(ke), O.push(ke);
682
+ }
683
+ B++, f.pos = U + 1;
684
+ } while (f.pos < m);
685
+ return y;
686
+ }
687
+ function Q(p) {
688
+ if (p.length === 0) return "";
689
+ let m = new w();
690
+ for (let f = 0; f < p.length; ) f = T(p, f, m, [0, 0, 0, 0, 0, 0, 0]);
691
+ return m.flush();
692
+ }
693
+ function T(p, m, f, y) {
694
+ let O = p[m], { 0: B, 1: ne, 2: te, 3: ie, isScope: C, callsite: P, bindings: K } = O;
695
+ y[0] < B ? (F(f, y[0], B), y[0] = B, y[1] = 0) : m > 0 && f.write(r), y[1] = u(f, O[1], y[1]);
696
+ let Y = (O.length === 6 ? 1 : 0) | (P ? 2 : 0) | (C ? 4 : 0);
697
+ if (u(f, Y, 0), O.length === 6) {
698
+ let { 4: U, 5: H } = O;
699
+ U !== y[2] && (y[3] = 0), y[2] = u(f, U, y[2]), y[3] = u(f, H, y[3]);
700
+ }
701
+ if (P) {
702
+ let { 0: U, 1: H, 2: se } = O.callsite;
703
+ U === y[4] ? H !== y[5] && (y[6] = 0) : (y[5] = 0, y[6] = 0), y[4] = u(f, U, y[4]), y[5] = u(f, H, y[5]), y[6] = u(f, se, y[6]);
704
+ }
705
+ if (K) for (let U of K) {
706
+ U.length > 1 && u(f, -U.length, 0);
707
+ let H = U[0][0];
708
+ u(f, H, 0);
709
+ let se = B, ee = ne;
710
+ for (let fe = 1; fe < U.length; fe++) {
711
+ let me = U[fe];
712
+ se = u(f, me[1], se), ee = u(f, me[2], ee), u(f, me[0], 0);
713
+ }
714
+ }
715
+ for (m++; m < p.length; ) {
716
+ let U = p[m], { 0: H, 1: se } = U;
717
+ if (H > te || H === te && se >= ie) break;
718
+ m = T(p, m, f, y);
719
+ }
720
+ return y[0] < te ? (F(f, y[0], te), y[0] = te, y[1] = 0) : f.write(r), y[1] = u(f, ie, y[1]), m;
721
+ }
722
+ function F(p, m, f) {
723
+ do
724
+ p.write(i);
725
+ while (++m < f);
726
+ }
727
+ function X(p) {
728
+ let { length: m } = p, f = new v(p), y = [], O = 0, B = 0, ne = 0, te = 0, ie = 0;
729
+ do {
730
+ let C = f.indexOf(";"), P = [], K = true, Y = 0;
731
+ for (O = 0; f.pos < C; ) {
732
+ let U;
733
+ O = c(f, O), O < Y && (K = false), Y = O, h(f, C) ? (B = c(f, B), ne = c(f, ne), te = c(f, te), h(f, C) ? (ie = c(f, ie), U = [O, B, ne, te, ie]) : U = [O, B, ne, te]) : U = [O], P.push(U), f.pos++;
734
+ }
735
+ K || V(P), y.push(P), f.pos = C + 1;
736
+ } while (f.pos <= m);
737
+ return y;
738
+ }
739
+ function V(p) {
740
+ p.sort(W);
741
+ }
742
+ function W(p, m) {
743
+ return p[0] - m[0];
744
+ }
745
+ function $(p) {
746
+ let m = new w(), f = 0, y = 0, O = 0, B = 0;
747
+ for (let ne = 0; ne < p.length; ne++) {
748
+ let te = p[ne];
749
+ if (ne > 0 && m.write(i), te.length === 0) continue;
750
+ let ie = 0;
751
+ for (let C = 0; C < te.length; C++) {
752
+ let P = te[C];
753
+ C > 0 && m.write(r), ie = u(m, P[0], ie), P.length !== 1 && (f = u(m, P[1], f), y = u(m, P[2], y), O = u(m, P[3], O), P.length !== 4 && (B = u(m, P[4], B)));
754
+ }
755
+ }
756
+ return m.flush();
757
+ }
758
+ n.decode = X, n.decodeGeneratedRanges = j, n.decodeOriginalScopes = z, n.encode = $, n.encodeGeneratedRanges = Q, n.encodeOriginalScopes = q, Object.defineProperty(n, "__esModule", { value: true });
759
+ });
760
+ });
761
+ rc(dc());
762
+ Sr();
763
+ var Fc = "application/x-react-grab";
764
+ var Xt = (e, t) => {
765
+ let n = JSON.stringify({ version: ni, content: e, timestamp: Date.now(), ...t?.prompt }), r = (o) => {
766
+ o.preventDefault(), o.clipboardData?.setData("text/plain", e), o.clipboardData?.setData(Fc, n);
767
+ };
768
+ document.addEventListener("copy", r);
769
+ let i = document.createElement("textarea");
770
+ i.value = e, i.style.position = "fixed", i.style.left = "-9999px", i.ariaHidden = "true", document.body.appendChild(i), i.select();
771
+ try {
772
+ let o = document.execCommand("copy");
773
+ return o && t?.onSuccess?.(), o;
774
+ } finally {
775
+ document.removeEventListener("copy", r), i.remove();
776
+ }
777
+ };
778
+ G('<span class="tabular-nums align-middle">');
779
+ G('<span class="font-mono tabular-nums align-middle">&lt;<!>>');
780
+ G('<span class="tabular-nums ml-1 align-middle"> in ');
781
+
782
+ // src/client.ts
783
+ var REFERENCE_PREFIX = "Use this as reference to make the change, do not actually write this code:\n\n";
784
+ var parseAgentResponse = (response) => {
785
+ const trimmed = response.trim();
786
+ if (trimmed.startsWith("{") && trimmed.endsWith("}")) {
787
+ try {
788
+ const parsed = JSON.parse(trimmed);
789
+ if (typeof parsed === "object" && "code" in parsed) {
790
+ return parsed;
791
+ }
792
+ } catch {
793
+ }
794
+ }
795
+ return trimmed;
796
+ };
797
+ var buildUserMessage = (prompt, html, isFirstMessage) => {
798
+ if (isFirstMessage) {
799
+ return `Here is the HTML to modify:
800
+
801
+ ${html}
802
+
803
+ Modification request: ${prompt}
804
+
805
+ You can either:
806
+ 1. Output ONLY the JavaScript code if you're confident in the change
807
+ 2. Output JSON to iterate: { "iterate": true, "code": "...", "reason": "why you need to see the result" }
808
+
809
+ When iterating, the code will be executed and you'll see the updated HTML to refine further.`;
810
+ }
811
+ return `Follow-up modification request: ${prompt}
812
+
813
+ Remember: Output ONLY the JavaScript code for this modification. The $el variable still references the same element.`;
814
+ };
815
+ var buildIterationMessage = (updatedHtml, executionResult) => {
816
+ let message = `Here is the updated HTML after executing your code:
817
+
818
+ ${updatedHtml}`;
819
+ if (executionResult) {
820
+ message += `
821
+
822
+ Execution result: ${executionResult}`;
823
+ }
824
+ message += `
825
+
826
+ Continue modifying or output final JavaScript code (without JSON wrapper) when done.`;
827
+ return message;
828
+ };
829
+ var createUndoableProxy = (element) => {
830
+ const undoActions = [];
831
+ const record = (action) => undoActions.push(action);
832
+ const removeNodes = (nodes) => {
833
+ for (const node of nodes) {
834
+ if (typeof node !== "string") node.parentNode?.removeChild(node);
835
+ }
836
+ };
837
+ const wrapNodeInsertion = (method) => ((...nodes) => {
838
+ method(...nodes);
839
+ record(() => removeNodes(nodes));
840
+ });
841
+ const styleProxy = new Proxy(element.style, {
842
+ set(target, prop, value) {
843
+ if (typeof prop === "string") {
844
+ const original = target.getPropertyValue(prop) || target[prop] || "";
845
+ record(() => {
846
+ target[prop] = original;
847
+ });
848
+ }
849
+ return Reflect.set(target, prop, value);
850
+ }
851
+ });
852
+ const classListProxy = new Proxy(element.classList, {
853
+ get(target, prop) {
854
+ if (prop === "add")
855
+ return (...classes) => {
856
+ const toUndo = classes.filter((c) => !target.contains(c));
857
+ record(() => target.remove(...toUndo));
858
+ return target.add(...classes);
859
+ };
860
+ if (prop === "remove")
861
+ return (...classes) => {
862
+ const toRestore = classes.filter((c) => target.contains(c));
863
+ record(() => target.add(...toRestore));
864
+ return target.remove(...classes);
865
+ };
866
+ if (prop === "toggle")
867
+ return (cls, force) => {
868
+ const had = target.contains(cls);
869
+ const result = target.toggle(cls, force);
870
+ record(() => had ? target.add(cls) : target.remove(cls));
871
+ return result;
872
+ };
873
+ if (prop === "replace")
874
+ return (oldCls, newCls) => {
875
+ const had = target.contains(oldCls);
876
+ const result = target.replace(oldCls, newCls);
877
+ if (had)
878
+ record(() => {
879
+ target.remove(newCls);
880
+ target.add(oldCls);
881
+ });
882
+ return result;
883
+ };
884
+ const value = Reflect.get(target, prop);
885
+ return typeof value === "function" ? value.bind(target) : value;
886
+ }
887
+ });
888
+ const datasetProxy = new Proxy(element.dataset, {
889
+ set(target, prop, value) {
890
+ if (typeof prop === "string") {
891
+ const original = target[prop];
892
+ const had = prop in target;
893
+ record(() => had ? target[prop] = original : delete target[prop]);
894
+ }
895
+ return Reflect.set(target, prop, value);
896
+ },
897
+ deleteProperty(target, prop) {
898
+ if (typeof prop === "string" && prop in target) {
899
+ const original = target[prop];
900
+ record(() => {
901
+ target[prop] = original;
902
+ });
903
+ }
904
+ return Reflect.deleteProperty(target, prop);
905
+ }
906
+ });
907
+ const getMethodHandler = (target, prop) => {
908
+ switch (prop) {
909
+ case "setAttribute":
910
+ return (name, value) => {
911
+ const had = target.hasAttribute(name);
912
+ const original = target.getAttribute(name);
913
+ record(
914
+ () => had ? target.setAttribute(name, original) : target.removeAttribute(name)
915
+ );
916
+ return target.setAttribute(name, value);
917
+ };
918
+ case "removeAttribute":
919
+ return (name) => {
920
+ if (target.hasAttribute(name)) {
921
+ const original = target.getAttribute(name);
922
+ record(() => target.setAttribute(name, original));
923
+ }
924
+ return target.removeAttribute(name);
925
+ };
926
+ case "appendChild":
927
+ return (child) => {
928
+ const result = target.appendChild(child);
929
+ record(() => child.parentNode?.removeChild(child));
930
+ return result;
931
+ };
932
+ case "removeChild":
933
+ return (child) => {
934
+ const nextSibling = child.nextSibling;
935
+ const result = target.removeChild(child);
936
+ record(() => target.insertBefore(child, nextSibling));
937
+ return result;
938
+ };
939
+ case "insertBefore":
940
+ return (node, ref) => {
941
+ const result = target.insertBefore(node, ref);
942
+ record(() => node.parentNode?.removeChild(node));
943
+ return result;
944
+ };
945
+ case "replaceChild":
946
+ return (newChild, oldChild) => {
947
+ const nextSibling = oldChild.nextSibling;
948
+ const result = target.replaceChild(newChild, oldChild);
949
+ record(() => {
950
+ target.replaceChild(oldChild, newChild);
951
+ if (nextSibling && oldChild.nextSibling !== nextSibling) {
952
+ target.insertBefore(oldChild, nextSibling);
953
+ }
954
+ });
955
+ return result;
956
+ };
957
+ case "remove":
958
+ return () => {
959
+ const parent = target.parentNode;
960
+ const nextSibling = target.nextSibling;
961
+ target.remove();
962
+ record(() => parent?.insertBefore(target, nextSibling));
963
+ };
964
+ case "append":
965
+ return wrapNodeInsertion(target.append.bind(target));
966
+ case "prepend":
967
+ return wrapNodeInsertion(target.prepend.bind(target));
968
+ case "after":
969
+ return wrapNodeInsertion(target.after.bind(target));
970
+ case "before":
971
+ return wrapNodeInsertion(target.before.bind(target));
972
+ case "replaceWith":
973
+ return (...nodes) => {
974
+ const parent = target.parentNode;
975
+ const nextSibling = target.nextSibling;
976
+ target.replaceWith(...nodes);
977
+ record(() => {
978
+ const firstNode = nodes.find((n) => typeof n !== "string");
979
+ if (parent) {
980
+ parent.insertBefore(target, firstNode ?? nextSibling);
981
+ removeNodes(nodes);
982
+ }
983
+ });
984
+ };
985
+ case "insertAdjacentHTML":
986
+ return (position, html) => {
987
+ const childrenBefore = Array.from(target.childNodes);
988
+ const siblingsBefore = target.parentNode ? Array.from(target.parentNode.childNodes) : [];
989
+ target.insertAdjacentHTML(position, html);
990
+ const addedChildren = Array.from(target.childNodes).filter(
991
+ (n) => !childrenBefore.includes(n)
992
+ );
993
+ const addedSiblings = target.parentNode ? Array.from(target.parentNode.childNodes).filter(
994
+ (n) => !siblingsBefore.includes(n)
995
+ ) : [];
996
+ record(
997
+ () => [...addedChildren, ...addedSiblings].forEach(
998
+ (n) => n.parentNode?.removeChild(n)
999
+ )
1000
+ );
1001
+ };
1002
+ case "insertAdjacentElement":
1003
+ return (position, el2) => {
1004
+ const result = target.insertAdjacentElement(position, el2);
1005
+ if (result) record(() => result.parentNode?.removeChild(result));
1006
+ return result;
1007
+ };
1008
+ default:
1009
+ return null;
1010
+ }
1011
+ };
1012
+ const handledMethods = /* @__PURE__ */ new Set([
1013
+ "setAttribute",
1014
+ "removeAttribute",
1015
+ "appendChild",
1016
+ "removeChild",
1017
+ "insertBefore",
1018
+ "replaceChild",
1019
+ "remove",
1020
+ "append",
1021
+ "prepend",
1022
+ "after",
1023
+ "before",
1024
+ "replaceWith",
1025
+ "insertAdjacentHTML",
1026
+ "insertAdjacentElement"
1027
+ ]);
1028
+ const proxy = new Proxy(element, {
1029
+ get(target, prop) {
1030
+ if (prop === "style") return styleProxy;
1031
+ if (prop === "classList") return classListProxy;
1032
+ if (prop === "dataset") return datasetProxy;
1033
+ if (typeof prop === "string" && handledMethods.has(prop)) {
1034
+ return getMethodHandler(target, prop);
1035
+ }
1036
+ const value = Reflect.get(target, prop);
1037
+ return typeof value === "function" ? value.bind(target) : value;
1038
+ },
1039
+ set(target, prop, value) {
1040
+ if (typeof prop === "string") {
1041
+ const original = target[prop];
1042
+ record(() => {
1043
+ target[prop] = original;
1044
+ });
1045
+ }
1046
+ return Reflect.set(target, prop, value);
1047
+ }
1048
+ });
1049
+ const undo = () => {
1050
+ for (let i = undoActions.length - 1; i >= 0; i--) undoActions[i]();
1051
+ };
1052
+ return { proxy, undo };
1053
+ };
1054
+ var DEFAULT_API_ENDPOINT = "https://www.react-grab.com/api/visual-edit";
1055
+ var ANCESTOR_LEVELS = 5;
1056
+ var FORBIDDEN_PATTERNS = [
1057
+ /\beval\s*\(/,
1058
+ /\bFunction\s*\(/,
1059
+ /\bdocument\.cookie\b/,
1060
+ /\bfetch\s*\(/,
1061
+ /\bXMLHttpRequest\b/
1062
+ ];
1063
+ var sanitizeCode = (code) => code.replace(/[\u2018\u2019\u2032\u2035]/g, "'").replace(/[\u201C\u201D\u2033\u2036]/g, '"').replace(/[\u2014\u2013\u2212]/g, "-").replace(/\u2026/g, "...").replace(/[\u00A0\u2000-\u200A\u202F\u205F]/g, " ").replace(/[\u200B-\u200D\uFEFF]/g, "");
1064
+ var validateCode = (code) => {
1065
+ const sanitizedCode = sanitizeCode(code);
1066
+ try {
1067
+ new Function("$el", sanitizedCode);
1068
+ } catch (err) {
1069
+ return {
1070
+ isValid: false,
1071
+ error: `Invalid JavaScript syntax${err instanceof Error ? `: ${err.message}` : ""}`,
1072
+ sanitizedCode
1073
+ };
1074
+ }
1075
+ for (const pattern of FORBIDDEN_PATTERNS) {
1076
+ if (pattern.test(sanitizedCode)) {
1077
+ return {
1078
+ isValid: false,
1079
+ error: `Potentially unsafe code detected: ${pattern.source}`,
1080
+ sanitizedCode
1081
+ };
1082
+ }
1083
+ }
1084
+ return { isValid: true, sanitizedCode };
1085
+ };
1086
+ var getOpeningTag = (element) => {
1087
+ const clone = element.cloneNode(false);
1088
+ const wrapper = document.createElement("div");
1089
+ wrapper.appendChild(clone);
1090
+ const html = wrapper.innerHTML;
1091
+ const closingTagMatch = html.match(/<\/[^>]+>$/);
1092
+ if (closingTagMatch) {
1093
+ return html.slice(0, -closingTagMatch[0].length);
1094
+ }
1095
+ return html;
1096
+ };
1097
+ var getClosingTag = (element) => {
1098
+ return `</${element.tagName.toLowerCase()}>`;
1099
+ };
1100
+ var buildAncestorContext = (element) => {
1101
+ const ancestors = [];
1102
+ let current = element.parentElement;
1103
+ for (let level = 0; level < ANCESTOR_LEVELS && current; level++) {
1104
+ if (current === document.body || current === document.documentElement) {
1105
+ break;
1106
+ }
1107
+ ancestors.push(current);
1108
+ current = current.parentElement;
1109
+ }
1110
+ if (ancestors.length === 0) {
1111
+ return element.outerHTML;
1112
+ }
1113
+ ancestors.reverse();
1114
+ let result = "";
1115
+ let indent = "";
1116
+ for (const ancestor of ancestors) {
1117
+ result += `${indent}${getOpeningTag(ancestor)}
1118
+ `;
1119
+ indent += " ";
1120
+ }
1121
+ result += `${indent}<!-- START $el -->
1122
+ `;
1123
+ const targetLines = element.outerHTML.split("\n");
1124
+ for (const line of targetLines) {
1125
+ result += `${indent}${line}
1126
+ `;
1127
+ }
1128
+ result += `${indent}<!-- END $el -->
1129
+ `;
1130
+ for (let ancestorIndex = ancestors.length - 1; ancestorIndex >= 0; ancestorIndex--) {
1131
+ indent = " ".repeat(ancestorIndex);
1132
+ result += `${indent}${getClosingTag(ancestors[ancestorIndex])}
1133
+ `;
1134
+ }
1135
+ return result.trim();
1136
+ };
1137
+ var createVisualEditAgentProvider = (options = {}) => {
1138
+ const apiEndpoint = options.apiEndpoint ?? DEFAULT_API_ENDPOINT;
1139
+ const maxIterations = options.maxIterations ?? 3;
1140
+ const elementHtmlMap = /* @__PURE__ */ new Map();
1141
+ const elementRefMap = /* @__PURE__ */ new Map();
1142
+ const resultCodeMap = /* @__PURE__ */ new Map();
1143
+ const undoFnMap = /* @__PURE__ */ new Map();
1144
+ const conversationHistoryMap = /* @__PURE__ */ new Map();
1145
+ let lastRequestId = null;
1146
+ let lastRequestStartTime = null;
1147
+ const getOptions = () => {
1148
+ const requestId = `req-${Date.now()}-${Math.random().toString(36).slice(2)}`;
1149
+ return { requestId };
1150
+ };
1151
+ const onStart = (session, element) => {
1152
+ const requestId = session.context.options?.requestId;
1153
+ if (!requestId || !element) return;
1154
+ const html = buildAncestorContext(element);
1155
+ elementHtmlMap.set(requestId, html);
1156
+ elementRefMap.set(requestId, element);
1157
+ };
1158
+ const fetchWithProgress = async function* (messages, signal) {
1159
+ let response = null;
1160
+ let fetchError = null;
1161
+ const fetchStartTime = Date.now();
1162
+ const fetchPromise = fetch(apiEndpoint, {
1163
+ method: "POST",
1164
+ headers: { "Content-Type": "application/json" },
1165
+ body: JSON.stringify({ messages }),
1166
+ signal
1167
+ }).then((fetchResponse) => {
1168
+ response = fetchResponse;
1169
+ }).catch((caughtError) => {
1170
+ fetchError = caughtError;
1171
+ });
1172
+ while (!response && !fetchError) {
1173
+ const elapsedSeconds = (Date.now() - fetchStartTime) / 1e3;
1174
+ yield elapsedSeconds >= 0.1 ? `Generating\u2026 ${elapsedSeconds.toFixed(1)}s` : `Generating\u2026`;
1175
+ await Promise.race([
1176
+ fetchPromise,
1177
+ new Promise((resolve) => setTimeout(resolve, 100))
1178
+ ]);
1179
+ }
1180
+ if (fetchError) {
1181
+ throw fetchError;
1182
+ }
1183
+ if (!response.ok) {
1184
+ const errorText = await response.text().catch(() => "Unknown error");
1185
+ throw new Error(`API error: ${response.status} - ${errorText}`);
1186
+ }
1187
+ yield await response.text();
1188
+ return "";
1189
+ };
1190
+ const executeIterationCode = (element, code) => {
1191
+ const { isValid, error, sanitizedCode } = validateCode(code);
1192
+ if (!isValid) {
1193
+ return {
1194
+ success: false,
1195
+ result: error ?? "Invalid code",
1196
+ updatedHtml: buildAncestorContext(element),
1197
+ undo: () => {
1198
+ }
1199
+ };
1200
+ }
1201
+ const { proxy, undo } = createUndoableProxy(element);
1202
+ try {
1203
+ const returnValue = new Function("$el", sanitizedCode).bind(null)(proxy);
1204
+ const result = returnValue !== void 0 ? String(returnValue) : null;
1205
+ return {
1206
+ success: true,
1207
+ result,
1208
+ updatedHtml: buildAncestorContext(element),
1209
+ undo
1210
+ };
1211
+ } catch (executionError) {
1212
+ undo();
1213
+ const errorMessage = executionError instanceof Error ? executionError.message : "Execution failed";
1214
+ return {
1215
+ success: false,
1216
+ result: errorMessage,
1217
+ updatedHtml: buildAncestorContext(element),
1218
+ undo: () => {
1219
+ }
1220
+ };
1221
+ }
1222
+ };
1223
+ const provider = {
1224
+ send: async function* (context, signal) {
1225
+ const requestId = context.options?.requestId ?? "";
1226
+ const sessionId = context.sessionId;
1227
+ const html = elementHtmlMap.get(requestId);
1228
+ const element = elementRefMap.get(requestId);
1229
+ if (!html || !element) {
1230
+ throw new Error("Could not capture element HTML");
1231
+ }
1232
+ const existingMessages = sessionId ? conversationHistoryMap.get(sessionId) ?? [] : [];
1233
+ const isFirstMessage = existingMessages.length === 0;
1234
+ const formattedUserMessage = buildUserMessage(
1235
+ context.prompt,
1236
+ html,
1237
+ isFirstMessage
1238
+ );
1239
+ const messages = [
1240
+ ...existingMessages,
1241
+ { role: "user", content: formattedUserMessage }
1242
+ ];
1243
+ lastRequestStartTime = Date.now();
1244
+ let iterationCount = 0;
1245
+ let finalCode = null;
1246
+ const iterationUndos = [];
1247
+ while (iterationCount <= maxIterations) {
1248
+ let responseText = "";
1249
+ for await (const progress of fetchWithProgress(messages, signal)) {
1250
+ if (typeof progress === "string" && !progress.startsWith("{")) {
1251
+ yield progress;
1252
+ }
1253
+ responseText = progress;
1254
+ }
1255
+ const parsedResponse = parseAgentResponse(responseText);
1256
+ if (typeof parsedResponse === "string") {
1257
+ finalCode = parsedResponse;
1258
+ messages.push({ role: "assistant", content: responseText });
1259
+ break;
1260
+ }
1261
+ if (!parsedResponse.iterate) {
1262
+ finalCode = parsedResponse.code;
1263
+ messages.push({ role: "assistant", content: responseText });
1264
+ break;
1265
+ }
1266
+ messages.push({ role: "assistant", content: responseText });
1267
+ yield `Applying\u2026`;
1268
+ const { success, result, updatedHtml, undo } = executeIterationCode(
1269
+ element,
1270
+ parsedResponse.code
1271
+ );
1272
+ iterationUndos.push(undo);
1273
+ const iterationFeedback = buildIterationMessage(
1274
+ updatedHtml,
1275
+ success ? result : `Error: ${result}`
1276
+ );
1277
+ messages.push({ role: "user", content: iterationFeedback });
1278
+ iterationCount++;
1279
+ }
1280
+ for (let undoIndex = iterationUndos.length - 1; undoIndex >= 0; undoIndex--) {
1281
+ iterationUndos[undoIndex]();
1282
+ }
1283
+ if (finalCode === null) {
1284
+ throw new Error("Max iterations reached without final code");
1285
+ }
1286
+ resultCodeMap.set(requestId, finalCode);
1287
+ conversationHistoryMap.set(sessionId ?? requestId, messages);
1288
+ yield "Applying changes\u2026";
1289
+ },
1290
+ supportsFollowUp: true,
1291
+ dismissButtonText: "Copy",
1292
+ getCompletionMessage: () => {
1293
+ if (lastRequestStartTime === null) return void 0;
1294
+ const totalSeconds = ((Date.now() - lastRequestStartTime) / 1e3).toFixed(
1295
+ 1
1296
+ );
1297
+ return `Completed in ${totalSeconds}s`;
1298
+ }
1299
+ };
1300
+ const cleanup = (requestId) => {
1301
+ elementHtmlMap.delete(requestId);
1302
+ elementRefMap.delete(requestId);
1303
+ resultCodeMap.delete(requestId);
1304
+ };
1305
+ const onComplete = (session, element) => {
1306
+ const requestId = session.context.options?.requestId;
1307
+ if (!requestId) return;
1308
+ const rawCode = resultCodeMap.get(requestId);
1309
+ if (!rawCode) return;
1310
+ const code = rawCode.trim();
1311
+ if (!element) {
1312
+ cleanup(requestId);
1313
+ return { error: "Could not find element to apply changes" };
1314
+ }
1315
+ if (code === "") {
1316
+ cleanup(requestId);
1317
+ return { error: "No changes generated" };
1318
+ }
1319
+ const { isValid, error, sanitizedCode } = validateCode(code);
1320
+ if (!isValid) {
1321
+ cleanup(requestId);
1322
+ return { error: error ?? "No changes generated" };
1323
+ }
1324
+ const { proxy, undo } = createUndoableProxy(element);
1325
+ undoFnMap.set(requestId, undo);
1326
+ lastRequestId = requestId;
1327
+ try {
1328
+ new Function("$el", sanitizedCode).bind(null)(proxy);
1329
+ } catch (executionError) {
1330
+ undo();
1331
+ undoFnMap.delete(requestId);
1332
+ lastRequestId = null;
1333
+ cleanup(requestId);
1334
+ const message = executionError instanceof Error ? executionError.message : "Code execution failed";
1335
+ return { error: message };
1336
+ }
1337
+ const reference = `${REFERENCE_PREFIX}${code}`;
1338
+ Xt(reference);
1339
+ cleanup(requestId);
1340
+ };
1341
+ const onUndo = () => {
1342
+ if (!lastRequestId) return;
1343
+ const undoFn = undoFnMap.get(lastRequestId);
1344
+ if (!undoFn) return;
1345
+ undoFn();
1346
+ undoFnMap.delete(lastRequestId);
1347
+ lastRequestId = null;
1348
+ };
1349
+ return { provider, getOptions, onStart, onComplete, onUndo };
1350
+ };
1351
+ var checkHealth = async () => {
1352
+ const controller = new AbortController();
1353
+ const timeoutId = setTimeout(() => controller.abort(), 1e3);
1354
+ try {
1355
+ const response = await fetch(DEFAULT_API_ENDPOINT, {
1356
+ method: "GET",
1357
+ signal: controller.signal
1358
+ });
1359
+ clearTimeout(timeoutId);
1360
+ if (!response.ok) return false;
1361
+ const data = await response.json().catch(() => null);
1362
+ return data?.healthy === true;
1363
+ } catch {
1364
+ clearTimeout(timeoutId);
1365
+ return false;
1366
+ }
1367
+ };
1368
+ var attachAgent = async () => {
1369
+ if (typeof window === "undefined") return;
1370
+ const isHealthy = await checkHealth();
1371
+ if (!isHealthy) return;
1372
+ const { provider, getOptions, onStart, onComplete, onUndo } = createVisualEditAgentProvider();
1373
+ const attach = (api2) => {
1374
+ api2.setAgent({
1375
+ provider,
1376
+ getOptions,
1377
+ onStart,
1378
+ onComplete,
1379
+ onUndo
1380
+ });
1381
+ };
1382
+ const api = window.__REACT_GRAB__;
1383
+ if (api) {
1384
+ attach(api);
1385
+ return;
1386
+ }
1387
+ window.addEventListener(
1388
+ "react-grab:init",
1389
+ (event) => {
1390
+ const customEvent = event;
1391
+ attach(customEvent.detail);
1392
+ },
1393
+ { once: true }
1394
+ );
1395
+ const apiAfterListener = window.__REACT_GRAB__;
1396
+ if (apiAfterListener) {
1397
+ attach(apiAfterListener);
1398
+ }
1399
+ };
1400
+ attachAgent();
1401
+ /**
1402
+ * @license MIT
1403
+ *
1404
+ * Copyright (c) 2025 Aiden Bai
1405
+ *
1406
+ * This source code is licensed under the MIT license found in the
1407
+ * LICENSE file in the root directory of this source tree.
1408
+ */
1409
+ /*! Bundled license information:
1410
+
1411
+ bippy/dist/rdt-hook-7WClMTWh.js:
1412
+ (**
1413
+ * @license bippy
1414
+ *
1415
+ * Copyright (c) Aiden Bai
1416
+ *
1417
+ * This source code is licensed under the MIT license found in the
1418
+ * LICENSE file in the root directory of this source tree.
1419
+ *)
1420
+
1421
+ bippy/dist/core-CoV0JPOT.js:
1422
+ (**
1423
+ * @license bippy
1424
+ *
1425
+ * Copyright (c) Aiden Bai
1426
+ *
1427
+ * This source code is licensed under the MIT license found in the
1428
+ * LICENSE file in the root directory of this source tree.
1429
+ *)
1430
+
1431
+ bippy/dist/source.js:
1432
+ (**
1433
+ * @license bippy
1434
+ *
1435
+ * Copyright (c) Aiden Bai
1436
+ *
1437
+ * This source code is licensed under the MIT license found in the
1438
+ * LICENSE file in the root directory of this source tree.
1439
+ *)
1440
+
1441
+ bippy/dist/install-hook-only-CTBENLgG.js:
1442
+ (**
1443
+ * @license bippy
1444
+ *
1445
+ * Copyright (c) Aiden Bai
1446
+ *
1447
+ * This source code is licensed under the MIT license found in the
1448
+ * LICENSE file in the root directory of this source tree.
1449
+ *)
1450
+
1451
+ bippy/dist/index.js:
1452
+ (**
1453
+ * @license bippy
1454
+ *
1455
+ * Copyright (c) Aiden Bai
1456
+ *
1457
+ * This source code is licensed under the MIT license found in the
1458
+ * LICENSE file in the root directory of this source tree.
1459
+ *)
1460
+ */
1461
+
1462
+ export { attachAgent, createVisualEditAgentProvider };